Some minor changes

This commit is contained in:
Observer KRypt0n_ 2021-10-24 14:14:47 +02:00
parent 8fead13fe1
commit c224f5aae9
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
2 changed files with 9 additions and 8 deletions

View file

@ -2,6 +2,7 @@ const path = require('path');
const fs = require('fs'); const fs = require('fs');
const { exec } = require('child_process'); const { exec } = require('child_process');
const { ipcRenderer } = require('electron'); const { ipcRenderer } = require('electron');
import $ from 'cash-dom'; import $ from 'cash-dom';
import { Genshinlib } from './lib/Genshinlib'; import { Genshinlib } from './lib/Genshinlib';

View file

@ -1,7 +1,7 @@
import GIJSON from '../types/GIJSON'; import GIJSON from '../types/GIJSON';
import { Tools } from './Tools'; import { Tools } from './Tools';
const Store = require('electron-store');
const store = require('electron-store');
const https = require('follow-redirects').https; const https = require('follow-redirects').https;
const fs = require('fs'); const fs = require('fs');
@ -10,7 +10,7 @@ const os = require('os');
const { spawn, exec } = require('child_process'); const { spawn, exec } = require('child_process');
const dns = require('dns'); const dns = require('dns');
const config = new Store({ const config = new store ({
defaults: { defaults: {
lang: { lang: {
launcher: 'en-us', launcher: 'en-us',
@ -23,8 +23,8 @@ const config = new Store({
version: null, version: null,
patch: null, patch: null,
runner: null, runner: null,
rpc: false, rpc: false
}, }
}); });
type Runner = { type Runner = {
@ -89,17 +89,17 @@ export class Genshinlib
// return new Promise(resolve => resolve(JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'dxvks.json'))))); // 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) if (property === null)
return config; 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<any> public static async getData (): Promise<any>