Generalized frontend model store (#193)

This commit is contained in:
Gregory Schier
2025-03-31 11:56:17 -07:00
committed by GitHub
parent ce885c3551
commit f1757ae427
201 changed files with 2185 additions and 2865 deletions

View File

@@ -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,
});