1
This commit is contained in:
@@ -227,7 +227,7 @@ const setOathAdaptation = (part: string, value: string) => {
|
||||
const partsToApply = oathBatchApply.value ? infoStore.oathParts : [part];
|
||||
partsToApply.forEach((item) => {
|
||||
if (!configStore.config.oaths[item]) {
|
||||
configStore.config.oaths[item] = { ...configStore.defaultOathConfig };
|
||||
configStore.config.oaths[item] = configStore.createDefaultOathConfig();
|
||||
}
|
||||
configStore.config.oaths[item].adaptation = Math.max(0, parsed);
|
||||
});
|
||||
@@ -488,7 +488,7 @@ const resetEquipPart = (part: string) => {
|
||||
|
||||
const resetOathPart = (part: string) => {
|
||||
configStore.config.oaths[part] = {
|
||||
...configStore.defaultOathConfig,
|
||||
...configStore.createDefaultOathConfig(),
|
||||
id: configStore.config.oaths[part]?.id ?? "",
|
||||
};
|
||||
setNotice(`已重置誓约槽位 ${part}。`);
|
||||
@@ -504,7 +504,7 @@ const resetAllForge = () => {
|
||||
});
|
||||
oathParts.value.forEach((part) => {
|
||||
configStore.config.oaths[part] = {
|
||||
...configStore.defaultOathConfig,
|
||||
...configStore.createDefaultOathConfig(),
|
||||
id: configStore.config.oaths[part]?.id ?? "",
|
||||
};
|
||||
});
|
||||
|
||||
@@ -104,10 +104,12 @@ const defaultAvatarConfig = {
|
||||
option: "0",
|
||||
};
|
||||
|
||||
const defaultOathConfig = {
|
||||
const createDefaultOathConfig = (): IConfigOath => ({
|
||||
id: "",
|
||||
adaptation: 0,
|
||||
};
|
||||
});
|
||||
|
||||
const defaultOathConfig = createDefaultOathConfig();
|
||||
|
||||
const createDefaultEmblemConfig = (): IConfigEmblem => ({
|
||||
lv: 0,
|
||||
@@ -202,7 +204,7 @@ export const useConfigStore = defineStore("configStore", () => {
|
||||
// oxlint-disable-next-line no-unused-expressions
|
||||
config.value &&
|
||||
!config.value?.oaths.hasOwnProperty(p) &&
|
||||
(config.value.oaths[p.toString()] = { ...defaultOathConfig });
|
||||
(config.value.oaths[p.toString()] = createDefaultOathConfig());
|
||||
});
|
||||
|
||||
infoStore.options.forEach((option) => {
|
||||
@@ -310,6 +312,7 @@ export const useConfigStore = defineStore("configStore", () => {
|
||||
defaultEqusConfig,
|
||||
defaultAvatarConfig,
|
||||
defaultOathConfig,
|
||||
createDefaultOathConfig,
|
||||
defaultEmblemConfig,
|
||||
createDefaultEmblemConfig,
|
||||
changeSourceLogs,
|
||||
|
||||
Reference in New Issue
Block a user