muxi feng commited on
Commit
5f35438
·
1 Parent(s): b57f2c5

清空数据是退出登录

Browse files
Files changed (1) hide show
  1. app/components/settings.tsx +5 -2
app/components/settings.tsx CHANGED
@@ -213,6 +213,7 @@ export function Settings() {
213
  const updateConfig = config.update;
214
  const resetConfig = config.reset;
215
  const chatStore = useChatStore();
 
216
 
217
  const updateStore = useUpdateStore();
218
  const [checkingUpdate, setCheckingUpdate] = useState(false);
@@ -298,8 +299,10 @@ export function Settings() {
298
  icon={<ClearIcon />}
299
  onClick={() => {
300
  if (confirm(Locale.Settings.Actions.ConfirmClearAll)) {
301
- chatStore.clearAllData();
302
- useUserStore.getState().reset();
 
 
303
  }
304
  }}
305
  bordered
 
213
  const updateConfig = config.update;
214
  const resetConfig = config.reset;
215
  const chatStore = useChatStore();
216
+ const userStore = useUserStore();
217
 
218
  const updateStore = useUpdateStore();
219
  const [checkingUpdate, setCheckingUpdate] = useState(false);
 
299
  icon={<ClearIcon />}
300
  onClick={() => {
301
  if (confirm(Locale.Settings.Actions.ConfirmClearAll)) {
302
+ userStore.logOut().then(()=>{
303
+ chatStore.clearAllData();
304
+ useUserStore.getState().reset();
305
+ })
306
  }
307
  }}
308
  bordered