From 6be6074c9dd3dd2376de0957b1408f035dbb8cd9 Mon Sep 17 00:00:00 2001 From: clem Date: Wed, 17 Jan 2024 12:57:24 +0200 Subject: [PATCH] fix event-bus --- package.json | 2 +- src/App.vue | 2 +- src/components/PageLoader.vue | 28 ++++++++++------------------ src/event-bus.js | 18 +++++++++++++++++- src/patchManager.js | 4 ++-- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 8a25bf3..0f6b4e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wow-launcher", - "version": "0.2.0", + "version": "1.0.0", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/src/App.vue b/src/App.vue index a5fb9ba..ec6a303 100644 --- a/src/App.vue +++ b/src/App.vue @@ -18,9 +18,9 @@ diff --git a/src/event-bus.js b/src/event-bus.js index 0190242..61e48d7 100644 --- a/src/event-bus.js +++ b/src/event-bus.js @@ -1,2 +1,18 @@ import Vue from 'vue'; -export const EventBus = new Vue(); \ No newline at end of file +export const EventBus = new Vue(); + +export const loaded = { + patches: false, + storage: false, + ftp_cli: false +}; + +console.log(`EVENT-BUS.js`); + +EventBus.$on(`event_loader_start`, () => { + console.log(`EVENT_LOADER_START`); +}); +EventBus.$on(`event_loader_stop`, (val) => { + if(val) { loaded[val] = true; } + console.log(`event_loader_stop`, val, loaded); +}); \ No newline at end of file diff --git a/src/patchManager.js b/src/patchManager.js index 84f4592..c17c662 100644 --- a/src/patchManager.js +++ b/src/patchManager.js @@ -125,8 +125,8 @@ class PatchManager { cwd: `storage`, name: `selectedPatch${this.language}` }); - console.info(`store.path:`, store.path); - const resolveVal = (!store.get(`updated`))? [] : store.get(`patches`); + EventBus.$emit(`event_loader_stop`, `storage`); + const resolveVal = (!store.get(`updated`)) ? [] : store.get(`patches`); console.log(`resolveVal`, resolveVal); return resolveVal; }