Skip to content

Commit

Permalink
fix(gui): do not persist loading flag
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 12, 2023
1 parent 25b64cc commit dcfce81
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gui/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function main() {
merge(params, config.params);

const defaults = paramsFromConfig(params);
const state = createStore<OnnxState, [['zustand/persist', never]]>(persist((set) => ({
const state = createStore<OnnxState, [['zustand/persist', OnnxState]]>(persist((set) => ({
defaults,
history: {
images: [],
Expand Down Expand Up @@ -170,6 +170,13 @@ export async function main() {
},
}), {
name: 'onnx-web',
partialize: (oldState) => ({
...oldState,
history: {
...oldState.history,
loading: false,
},
}),
storage: createJSONStorage(() => localStorage),
}));

Expand Down

0 comments on commit dcfce81

Please sign in to comment.