Skip to content

Commit 98d25e8

Browse files
committed
fix: AquaMai 配置第一次修改的时候存不上
1 parent 9ba92e8 commit 98d25e8

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

MaiChartManager/Front/src/views/ModManager/refs.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import api from "@/client/api";
22
import { useAsyncState } from '@vueuse/core';
3-
import { computed, ref } from 'vue';
3+
import { computed, nextTick, ref } from 'vue';
44
import { debounce } from 'perfect-debounce';
55
import { ConfigDto } from "@/client/apiGen";
66
import { globalCapture, modInfo, updateModInfo } from "@/store/refs";
@@ -14,7 +14,7 @@ const skipSignatureCheckRef = ref(false);
1414
export const configReadErr = ref('');
1515
export const configReadErrTitle = ref('');
1616

17-
// 标志位:配置刚从服务器加载,watcher 应忽略首次变更
17+
// 防止在 mod 管理页面,一加载就触发保存
1818
export const configJustLoaded = ref(false);
1919

2020
const { state: aquaMaiConfig, execute: executeGetConfig, isLoading: configLoading } = useAsyncState(async () => {
@@ -56,7 +56,7 @@ const { state: aquaMaiConfig, execute: executeGetConfig, isLoading: configLoadin
5656
forceDefaultRef.value = false;
5757
skipSignatureCheckRef.value = false;
5858
}
59-
}, undefined as ConfigDto | undefined, { immediate: false, shallow: false });
59+
}, undefined as ConfigDto | undefined, { immediate: false, shallow: false, resetOnExecute: false });
6060

6161
export { aquaMaiConfig, configLoading };
6262

@@ -65,6 +65,8 @@ export const updateAquaMaiConfig = async (forceDefault = false, skipSignatureChe
6565
skipSignatureCheckRef.value = skipSignatureCheck;
6666
configJustLoaded.value = true;
6767
await executeGetConfig();
68+
await nextTick();
69+
configJustLoaded.value = false;
6870
};
6971

7072
// MuMod 状态

0 commit comments

Comments
 (0)