diff --git a/packages/tools/src/testPermission.ts b/packages/tools/src/testPermission.ts index 40acd071..d6b805f9 100644 --- a/packages/tools/src/testPermission.ts +++ b/packages/tools/src/testPermission.ts @@ -104,7 +104,7 @@ export function getPredefinedPermissions(predefinedRoleName: string) { return ['*', '~widgets/*', 'widgets/admin']; case 'logged-user': return ['*', '~widgets/admin', '~admin/*']; - case 'anonymouse-user': + case 'anonymous-user': return ['*', '~widgets/admin', '~admin/*']; default: return null; diff --git a/packages/web/src/stores.ts b/packages/web/src/stores.ts index c04788b0..1a4995a3 100644 --- a/packages/web/src/stores.ts +++ b/packages/web/src/stores.ts @@ -7,7 +7,7 @@ import { getSettings, useConfig, useSettings } from './utility/metadataLoaders'; import _ from 'lodash'; import { safeJsonParse } from 'dbgate-tools'; import { apiCall } from './utility/api'; -import { getOpenedTabsStorageName } from './utility/pageDefs'; +import { getOpenedTabsStorageName, isAdminPage } from './utility/pageDefs'; export interface TabDefinition { title: string; @@ -73,7 +73,7 @@ function subscribeCssVariable(store, transform, cssVariable) { store.subscribe(value => document.documentElement.style.setProperty(cssVariable, transform(value))); } -export const selectedWidget = writableWithStorage('database', 'selectedWidget'); +export const selectedWidget = writableWithStorage('database', isAdminPage() ? 'selectedAdminWidget' : 'selectedWidget'); export const lockedDatabaseMode = writableWithStorage(false, 'lockedDatabaseMode'); export const visibleWidgetSideBar = writableWithStorage(true, 'visibleWidgetSideBar'); export const visibleSelectedWidget = derived(