chore: Prettified Code
[ci skip]
This commit is contained in:
parent
9dde8548a2
commit
c80f66a9f3
1 changed files with 6 additions and 6 deletions
|
@ -1,9 +1,9 @@
|
||||||
import * as ElectronStore from "electron-store";
|
import * as ElectronStore from "electron-store";
|
||||||
import {app, ipcMain} from "electron";
|
import { app, ipcMain } from "electron";
|
||||||
import fetch from "electron-fetch";
|
import fetch from "electron-fetch";
|
||||||
import {existsSync} from "fs";
|
import { existsSync } from "fs";
|
||||||
import {join} from "path";
|
import { join } from "path";
|
||||||
import {utils} from "./utils"
|
import { utils } from "./utils";
|
||||||
|
|
||||||
export class Store {
|
export class Store {
|
||||||
static cfg: ElectronStore;
|
static cfg: ElectronStore;
|
||||||
|
@ -232,7 +232,7 @@ export class Store {
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.defaults.general.language = this.checkLocale(app.getLocale().replace('-', '_')) ?? "en_US"
|
this.defaults.general.language = this.checkLocale(app.getLocale().replace("-", "_")) ?? "en_US";
|
||||||
Store.cfg = new ElectronStore({
|
Store.cfg = new ElectronStore({
|
||||||
name: "cider-config",
|
name: "cider-config",
|
||||||
defaults: this.defaults,
|
defaults: this.defaults,
|
||||||
|
@ -326,6 +326,6 @@ export class Store {
|
||||||
}
|
}
|
||||||
|
|
||||||
private checkLocale(language: string) {
|
private checkLocale(language: string) {
|
||||||
return (existsSync(join(utils.getPath("i18nPath"), `${language}.json`))) ? language : "en_US";
|
return existsSync(join(utils.getPath("i18nPath"), `${language}.json`)) ? language : "en_US";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue