This commit is contained in:
frostime 2024-04-30 22:15:50 +08:00
parent 3d565424ae
commit 9f54e7046c

View file

@ -3,7 +3,7 @@
* @Author : frostime
* @Date : 2023-12-17 18:28:19
* @FilePath : /src/libs/setting-utils.ts
* @LastEditTime : 2024-04-30 16:42:23
* @LastEditTime : 2024-04-30 22:15:25
* @Description :
*/
@ -105,7 +105,7 @@ export class SettingUtils {
args.callback(data);
}
this.plugin.data[this.name] = data;
this.save();
this.save(data);
},
destroyCallback: () => {
//Restore the original value
@ -128,8 +128,8 @@ export class SettingUtils {
return data;
}
async save() {
let data = this.dump();
async save(data?: any) {
data = data ?? this.dump();
await this.plugin.saveData(this.file, this.dump());
console.debug('Save config:', data);
return data;