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"
},
"dependencies": {
"@empathize/framework": "^1.4.2",
"@empathize/framework": "^1.4.3",
"js-md5": "^0.7.3",
"semver": "^7.3.5",
"svelte-i18n": "^3.3.13",

View file

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

View file

@ -17,16 +17,6 @@
import GearActive from './assets/images/gear-active.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);
Neutralino.events.on('ready', () => {

View file

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

View file

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