mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
feat(tabs-store): persist only problemTab and workspaceTab in local storage
This commit is contained in:
parent
2b6b7c54d5
commit
8bf109679d
@ -22,15 +22,17 @@ export const useTabsStore = create<TabsState>()(
|
||||
}),
|
||||
{
|
||||
name: "tabs-active",
|
||||
onRehydrateStorage:
|
||||
() =>
|
||||
(state, error) => {
|
||||
if (error) {
|
||||
console.error("hydrate error", error);
|
||||
} else if (state) {
|
||||
state.setHydrated(true);
|
||||
}
|
||||
},
|
||||
partialize: (state) => ({
|
||||
problemTab: state.problemTab,
|
||||
workspaceTab: state.workspaceTab,
|
||||
}),
|
||||
onRehydrateStorage: () => (state, error) => {
|
||||
if (error) {
|
||||
console.error("hydrate error", error);
|
||||
} else if (state) {
|
||||
state.setHydrated(true);
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user