mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-09 18:53:38 +02:00
Generalized frontend model store (#193)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { useActiveWorkspace } from './useActiveWorkspace';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { activeWorkspaceIdAtom } from './useActiveWorkspace';
|
||||
import { useKeyValue } from './useKeyValue';
|
||||
|
||||
export function useSidebarHidden() {
|
||||
const activeWorkspace = useActiveWorkspace();
|
||||
const activeWorkspaceId = useAtomValue(activeWorkspaceIdAtom);
|
||||
const { set, value } = useKeyValue<boolean>({
|
||||
namespace: 'no_sync',
|
||||
key: ['sidebar_hidden', activeWorkspace?.id ?? 'n/a'],
|
||||
key: ['sidebar_hidden', activeWorkspaceId ?? 'n/a'],
|
||||
fallback: false,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user