summaryrefslogtreecommitdiff
path: root/apps/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/lib')
-rw-r--r--apps/web/lib/stores/user-interface-store.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/web/lib/stores/user-interface-store.ts b/apps/web/lib/stores/user-interface-store.ts
index 5890167..01dceba 100644
--- a/apps/web/lib/stores/user-interface-store.ts
+++ b/apps/web/lib/stores/user-interface-store.ts
@@ -44,6 +44,8 @@ interface UserInterfaceState {
isShortcutsDialogOpen: boolean
expandedFolderIdentifiers: string[]
navigableEntryIdentifiers: string[]
+ resetSidebarLayout: (() => void) | null
+ resetDetailLayout: (() => void) | null
toggleSidebar: () => void
setSidebarCollapsed: (isCollapsed: boolean) => void
@@ -67,6 +69,8 @@ interface UserInterfaceState {
toggleShortcutsDialog: () => void
toggleFolderExpansion: (folderIdentifier: string) => void
setNavigableEntryIdentifiers: (identifiers: string[]) => void
+ setResetSidebarLayout: (callback: (() => void) | null) => void
+ setResetDetailLayout: (callback: (() => void) | null) => void
}
export const useUserInterfaceStore = create<UserInterfaceState>()(
@@ -92,6 +96,8 @@ export const useUserInterfaceStore = create<UserInterfaceState>()(
isShortcutsDialogOpen: false,
expandedFolderIdentifiers: [],
navigableEntryIdentifiers: [],
+ resetSidebarLayout: null,
+ resetDetailLayout: null,
toggleSidebar: () =>
set((state) => ({ isSidebarCollapsed: !state.isSidebarCollapsed })),
@@ -155,6 +161,12 @@ export const useUserInterfaceStore = create<UserInterfaceState>()(
setNavigableEntryIdentifiers: (identifiers) =>
set({ navigableEntryIdentifiers: identifiers }),
+
+ setResetSidebarLayout: (callback) =>
+ set({ resetSidebarLayout: callback }),
+
+ setResetDetailLayout: (callback) =>
+ set({ resetDetailLayout: callback }),
}),
{
name: "asa-news-ui-preferences",