From c224f5aae961f671af72825e26e815f86c8c89c4 Mon Sep 17 00:00:00 2001 From: Observer KRypt0n_ Date: Sun, 24 Oct 2021 14:14:47 +0200 Subject: [PATCH] Some minor changes --- src/ts/index.ts | 1 + src/ts/lib/Genshinlib.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/ts/index.ts b/src/ts/index.ts index aedad4c..0584aa8 100644 --- a/src/ts/index.ts +++ b/src/ts/index.ts @@ -2,6 +2,7 @@ const path = require('path'); const fs = require('fs'); const { exec } = require('child_process'); const { ipcRenderer } = require('electron'); + import $ from 'cash-dom'; import { Genshinlib } from './lib/Genshinlib'; diff --git a/src/ts/lib/Genshinlib.ts b/src/ts/lib/Genshinlib.ts index b112af4..971647e 100644 --- a/src/ts/lib/Genshinlib.ts +++ b/src/ts/lib/Genshinlib.ts @@ -1,7 +1,7 @@ import GIJSON from '../types/GIJSON'; import { Tools } from './Tools'; -const Store = require('electron-store'); +const store = require('electron-store'); const https = require('follow-redirects').https; const fs = require('fs'); @@ -10,7 +10,7 @@ const os = require('os'); const { spawn, exec } = require('child_process'); const dns = require('dns'); -const config = new Store({ +const config = new store ({ defaults: { lang: { launcher: 'en-us', @@ -23,8 +23,8 @@ const config = new Store({ version: null, patch: null, runner: null, - rpc: false, - }, + rpc: false + } }); type Runner = { @@ -89,17 +89,17 @@ export class Genshinlib // return new Promise(resolve => resolve(JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'dxvks.json'))))); } - public static getConfig (property: string|null = null, splitProperty: boolean = true): any + public static getConfig (property: string|null = null): any { if (property === null) return config; - return config.get(property) + return config.get(property); } - public static updateConfig (cname: string, value: string|boolean|null|number): Genshinlib + public static updateConfig (property: string, value: string|boolean|null|number): Genshinlib { - return config.set(cname, value); + return config.set(property, value); } public static async getData (): Promise