Merge branch 'upcoming' of https://github.com/ciderapp/Cider into upcoming

This commit is contained in:
vapormusic 2022-01-26 13:19:24 +07:00
commit 694a75c4a0
10 changed files with 305 additions and 84 deletions

View file

@ -2,7 +2,7 @@ import * as Store from 'electron-store';
import * as electron from "electron";
export class ConfigStore {
public store: Store | undefined;
private _store: Store;
private defaults: any = {
"general": {
@ -89,14 +89,26 @@ export class ConfigStore {
private migrations: any = {}
constructor() {
this.store = new Store({
this._store = new Store({
name: 'cider-config',
defaults: this.defaults,
migrations: this.migrations,
});
this.store.set(this.mergeStore(this.defaults, this.store.store))
this.ipcHandler(this.store);
this._store.set(this.mergeStore(this.defaults, this._store.store))
this.ipcHandler(this._store);
}
get store() {
return this._store.store;
}
get(key: string) {
return this._store.get(key);
}
set(key: string, value: any) {
this._store.set(key, value);
}
/**