Skip to content

Commit

Permalink
feat: Only auto save chart when config changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne committed Jan 25, 2023
1 parent 6ce9fc6 commit 7a3f665
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/configurator/configurator-state.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ const ConfiguratorStateProviderInternal = ({
const locale = useLocale();
const stateAndDispatch = useImmerReducer(reducer, initialState);
const [state, dispatch] = stateAndDispatch;
const { asPath, push, replace, query } = useRouter();
const { push, replace, query } = useRouter();
const client = useClient();

// Re-initialize state on page load
Expand Down Expand Up @@ -1616,7 +1616,7 @@ const ConfiguratorStateProviderInternal = ({
}
};
run();
}, [state, dispatch, chartId, push, asPath, locale, query.from, replace]);
}, [dispatch, push, replace, state]);

return (
<ConfiguratorStateContext.Provider value={stateAndDispatch}>
Expand Down

0 comments on commit 7a3f665

Please sign in to comment.