forked from XiaoMo/ChatGPT-Next-Web
fix: #2208 use global settings button dose not work
This commit is contained in:
parent
9057712c8f
commit
ee55f8790e
@ -134,14 +134,19 @@ export function MaskConfig(props: {
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={props.mask.syncGlobalConfig}
|
checked={props.mask.syncGlobalConfig}
|
||||||
onChange={async (e) => {
|
onChange={async (e) => {
|
||||||
|
const checked = e.currentTarget.checked;
|
||||||
if (
|
if (
|
||||||
e.currentTarget.checked &&
|
checked &&
|
||||||
(await showConfirm(Locale.Mask.Config.Sync.Confirm))
|
(await showConfirm(Locale.Mask.Config.Sync.Confirm))
|
||||||
) {
|
) {
|
||||||
props.updateMask((mask) => {
|
props.updateMask((mask) => {
|
||||||
mask.syncGlobalConfig = e.currentTarget.checked;
|
mask.syncGlobalConfig = checked;
|
||||||
mask.modelConfig = { ...globalConfig.modelConfig };
|
mask.modelConfig = { ...globalConfig.modelConfig };
|
||||||
});
|
});
|
||||||
|
} else if (!checked) {
|
||||||
|
props.updateMask((mask) => {
|
||||||
|
mask.syncGlobalConfig = checked;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
></input>
|
></input>
|
||||||
|
@ -81,8 +81,7 @@ export const useUpdateStore = create<UpdateStore>()(
|
|||||||
|
|
||||||
set(() => ({ version }));
|
set(() => ({ version }));
|
||||||
|
|
||||||
const shouldCheck =
|
const shouldCheck = Date.now() - get().lastUpdate > 2 * 60 * ONE_MINUTE;
|
||||||
Date.now() - get().lastUpdate > 24 * 60 * ONE_MINUTE;
|
|
||||||
if (!force && !shouldCheck) return;
|
if (!force && !shouldCheck) return;
|
||||||
|
|
||||||
set(() => ({
|
set(() => ({
|
||||||
|
Loading…
Reference in New Issue
Block a user