From ee55f8790ed25cb0a105a086ce32f884089864b6 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Sat, 1 Jul 2023 18:16:06 +0800 Subject: [PATCH] fix: #2208 use global settings button dose not work --- app/components/mask.tsx | 9 +++++++-- app/store/update.ts | 3 +-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/components/mask.tsx b/app/components/mask.tsx index c10ba476..ea7cf3a5 100644 --- a/app/components/mask.tsx +++ b/app/components/mask.tsx @@ -134,14 +134,19 @@ export function MaskConfig(props: { type="checkbox" checked={props.mask.syncGlobalConfig} onChange={async (e) => { + const checked = e.currentTarget.checked; if ( - e.currentTarget.checked && + checked && (await showConfirm(Locale.Mask.Config.Sync.Confirm)) ) { props.updateMask((mask) => { - mask.syncGlobalConfig = e.currentTarget.checked; + mask.syncGlobalConfig = checked; mask.modelConfig = { ...globalConfig.modelConfig }; }); + } else if (!checked) { + props.updateMask((mask) => { + mask.syncGlobalConfig = checked; + }); } }} > diff --git a/app/store/update.ts b/app/store/update.ts index c336f03f..dd4d3c72 100644 --- a/app/store/update.ts +++ b/app/store/update.ts @@ -81,8 +81,7 @@ export const useUpdateStore = create()( set(() => ({ version })); - const shouldCheck = - Date.now() - get().lastUpdate > 24 * 60 * ONE_MINUTE; + const shouldCheck = Date.now() - get().lastUpdate > 2 * 60 * ONE_MINUTE; if (!force && !shouldCheck) return; set(() => ({