Fixed actions execution issues in the launcher's core libraries

This commit is contained in:
Observer KRypt0n_ 2022-01-30 20:45:38 +02:00
parent 6257c7fab4
commit 081a330830
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
5 changed files with 25 additions and 20 deletions

View file

@ -11,7 +11,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json" "check": "svelte-check --tsconfig ./tsconfig.json"
}, },
"dependencies": { "dependencies": {
"@empathize/framework": "^1.4.2", "@empathize/framework": "^1.4.3",
"js-md5": "^0.7.3", "js-md5": "^0.7.3",
"semver": "^7.3.5", "semver": "^7.3.5",
"svelte-i18n": "^3.3.13", "svelte-i18n": "^3.3.13",

View file

@ -3,8 +3,8 @@ import { Configs, promisify } from './empathize';
import constants from './ts/Constants'; import constants from './ts/Constants';
import Locales from './ts/launcher/Locales'; import Locales from './ts/launcher/Locales';
promisify(async () => { export default new Promise<void>(async (resolve) => {
Configs.defaults({ await Configs.defaults({
lang: { lang: {
launcher: await Locales.system(), launcher: await Locales.system(),
voice: [ voice: [
@ -199,4 +199,6 @@ promisify(async () => {
launcher: '5d' launcher: '5d'
} }
}); });
resolve();
}); });

View file

@ -17,16 +17,6 @@
import GearActive from './assets/images/gear-active.png'; import GearActive from './assets/images/gear-active.png';
import Download from './assets/images/cloud-download.png'; import Download from './assets/images/cloud-download.png';
constants.paths.launcherDir.then((dir) => {
// Create launcher folder if it doesn't exist
Neutralino.filesystem.getStats(dir)
.catch(() => Neutralino.filesystem.createDirectory(dir));
// Create logs folder if it doesn't exist
Neutralino.filesystem.getStats(`${dir}/logs`)
.catch(() => Neutralino.filesystem.createDirectory(`${dir}/logs`));
});
const launcher = new Launcher(onMount); const launcher = new Launcher(onMount);
Neutralino.events.on('ready', () => { Neutralino.events.on('ready', () => {

View file

@ -5,8 +5,6 @@ declare const Neutralino;
Neutralino.init(); Neutralino.init();
Neutralino.events.on('ready', () => import('../defaultSettings'));
const app = new App({ const app = new App({
target: document.getElementById('app')! target: document.getElementById('app')!
}); });

View file

@ -2,7 +2,7 @@ import { locale } from 'svelte-i18n';
import { import {
Windows, Process, Tray, Windows, Process, Tray,
Configs, Debug, IPC Configs, Debug, IPC, fs, path
} from '../empathize'; } from '../empathize';
import constants from './Constants'; import constants from './Constants';
@ -36,11 +36,26 @@ export default class Launcher
this.tray = new Tray(`/public/icons/256x256.png`); this.tray = new Tray(`/public/icons/256x256.png`);
this.tray.update(); this.tray.update();
this.updateDiscordRPC('in-launcher'); onMount(async () => {
const launcherDir = await constants.paths.launcherDir;
onMount(() => { // Create launcher folder if it doesn't exist
this.progressBar = new ProgressBar(this); if (!await fs.exists(launcherDir))
this.state = new State(this); await fs.mkdir(launcherDir);
// Create logs folder if it doesn't exist
if (!await fs.exists(path.join(launcherDir, 'logs')))
await fs.mkdir(path.join(launcherDir, 'logs'));
// Applying default settings
const defaultSetings = (await import('../defaultSettings')).default;
defaultSetings.then(() => {
this.updateDiscordRPC('in-launcher');
this.progressBar = new ProgressBar(this);
this.state = new State(this);
});
}); });
} }