diff --git a/src-web/components/Sidebar.tsx b/src-web/components/Sidebar.tsx index 8521381a..f9e33996 100644 --- a/src-web/components/Sidebar.tsx +++ b/src-web/components/Sidebar.tsx @@ -86,7 +86,7 @@ export function Sidebar({ className }: Props) { const [hoveredIndex, setHoveredIndex] = useState(null); const collapsed = useKeyValue>({ key: ['sidebar_collapsed', activeWorkspace?.id ?? 'n/a'], - defaultValue: {}, + fallback: {}, namespace: NAMESPACE_NO_SYNC, }); diff --git a/src-web/hooks/useActiveCookieJar.ts b/src-web/hooks/useActiveCookieJar.ts index 225dd11f..e31f403c 100644 --- a/src-web/hooks/useActiveCookieJar.ts +++ b/src-web/hooks/useActiveCookieJar.ts @@ -11,7 +11,7 @@ export function useActiveCookieJar() { const kv = useKeyValue({ namespace: NAMESPACE_GLOBAL, key: ['activeCookieJar', workspaceId ?? 'n/a'], - defaultValue: null, + fallback: null, }); const activeCookieJar = cookieJars.find((cookieJar) => cookieJar.id === kv.value); diff --git a/src-web/hooks/useCreateDropdownItems.tsx b/src-web/hooks/useCreateDropdownItems.tsx index 150135c0..a9d2e98e 100644 --- a/src-web/hooks/useCreateDropdownItems.tsx +++ b/src-web/hooks/useCreateDropdownItems.tsx @@ -54,6 +54,6 @@ export function useCreateDropdownItems({ }, ]) as DropdownItem[]), ], - [createFolder, createGrpcRequest, createHttpRequest, hideFolder], + [createFolder, createGrpcRequest, createHttpRequest, folderId, hideFolder, hideIcons], ); } diff --git a/src-web/hooks/useRecentEnvironments.ts b/src-web/hooks/useRecentEnvironments.ts index 8ea6ccff..05fbb30c 100644 --- a/src-web/hooks/useRecentEnvironments.ts +++ b/src-web/hooks/useRecentEnvironments.ts @@ -7,7 +7,7 @@ import { useKeyValue } from './useKeyValue'; const kvKey = (workspaceId: string) => 'recent_environments::' + workspaceId; const namespace = NAMESPACE_GLOBAL; -const defaultValue: string[] = []; +const fallback: string[] = []; export function useRecentEnvironments() { const environments = useEnvironments(); @@ -16,7 +16,7 @@ export function useRecentEnvironments() { const kv = useKeyValue({ key: kvKey(activeWorkspaceId ?? 'n/a'), namespace, - defaultValue, + fallback, }); // Set history when active request changes @@ -41,6 +41,6 @@ export async function getRecentEnvironments(workspaceId: string) { return getKeyValue({ namespace, key: kvKey(workspaceId), - fallback: defaultValue, + fallback, }); } diff --git a/src-web/hooks/useRecentRequests.ts b/src-web/hooks/useRecentRequests.ts index 210fb396..6ca2fa61 100644 --- a/src-web/hooks/useRecentRequests.ts +++ b/src-web/hooks/useRecentRequests.ts @@ -8,7 +8,7 @@ import { useKeyValue } from './useKeyValue'; const kvKey = (workspaceId: string) => 'recent_requests::' + workspaceId; const namespace = NAMESPACE_GLOBAL; -const defaultValue: string[] = []; +const fallback: string[] = []; export function useRecentRequests() { const httpRequests = useHttpRequests(); @@ -20,7 +20,7 @@ export function useRecentRequests() { const kv = useKeyValue({ key: kvKey(activeWorkspaceId ?? 'n/a'), namespace, - defaultValue, + fallback, }); // Set history when active request changes @@ -45,6 +45,6 @@ export async function getRecentRequests(workspaceId: string) { return getKeyValue({ namespace, key: kvKey(workspaceId), - fallback: defaultValue, + fallback, }); } diff --git a/src-web/hooks/useRecentWorkspaces.ts b/src-web/hooks/useRecentWorkspaces.ts index 20a021d0..767f3092 100644 --- a/src-web/hooks/useRecentWorkspaces.ts +++ b/src-web/hooks/useRecentWorkspaces.ts @@ -6,7 +6,7 @@ import { useWorkspaces } from './useWorkspaces'; const kvKey = () => 'recent_workspaces'; const namespace = NAMESPACE_GLOBAL; -const defaultValue: string[] = []; +const fallback: string[] = []; export function useRecentWorkspaces() { const workspaces = useWorkspaces(); @@ -14,7 +14,7 @@ export function useRecentWorkspaces() { const kv = useKeyValue({ key: kvKey(), namespace, - defaultValue, + fallback, }); // Set history when active request changes @@ -39,6 +39,6 @@ export async function getRecentWorkspaces() { return getKeyValue({ namespace, key: kvKey(), - fallback: defaultValue, + fallback: fallback, }); } diff --git a/src-web/hooks/useSidebarHidden.ts b/src-web/hooks/useSidebarHidden.ts index 9fd4bee0..d6b3e9c0 100644 --- a/src-web/hooks/useSidebarHidden.ts +++ b/src-web/hooks/useSidebarHidden.ts @@ -8,7 +8,7 @@ export function useSidebarHidden() { const { set, value } = useKeyValue({ namespace: NAMESPACE_NO_SYNC, key: ['sidebar_hidden', activeWorkspaceId ?? 'n/a'], - defaultValue: false, + fallback: false, }); return useMemo(() => {