✨ misc
This commit is contained in:
parent
3d565424ae
commit
9f54e7046c
1 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
* @Author : frostime
|
* @Author : frostime
|
||||||
* @Date : 2023-12-17 18:28:19
|
* @Date : 2023-12-17 18:28:19
|
||||||
* @FilePath : /src/libs/setting-utils.ts
|
* @FilePath : /src/libs/setting-utils.ts
|
||||||
* @LastEditTime : 2024-04-30 16:42:23
|
* @LastEditTime : 2024-04-30 22:15:25
|
||||||
* @Description :
|
* @Description :
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ export class SettingUtils {
|
||||||
args.callback(data);
|
args.callback(data);
|
||||||
}
|
}
|
||||||
this.plugin.data[this.name] = data;
|
this.plugin.data[this.name] = data;
|
||||||
this.save();
|
this.save(data);
|
||||||
},
|
},
|
||||||
destroyCallback: () => {
|
destroyCallback: () => {
|
||||||
//Restore the original value
|
//Restore the original value
|
||||||
|
@ -128,8 +128,8 @@ export class SettingUtils {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async save() {
|
async save(data?: any) {
|
||||||
let data = this.dump();
|
data = data ?? this.dump();
|
||||||
await this.plugin.saveData(this.file, this.dump());
|
await this.plugin.saveData(this.file, this.dump());
|
||||||
console.debug('Save config:', data);
|
console.debug('Save config:', data);
|
||||||
return data;
|
return data;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue