Skip to content

Commit

Permalink
fix: #2208 use global settings button dose not work
Browse files Browse the repository at this point in the history
  • Loading branch information
Yidadaa committed Jul 1, 2023
1 parent 9057712 commit ee55f87
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 7 additions & 2 deletions app/components/mask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}
}}
></input>
Expand Down
3 changes: 1 addition & 2 deletions app/store/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ export const useUpdateStore = create<UpdateStore>()(

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(() => ({
Expand Down

0 comments on commit ee55f87

Please sign in to comment.