From 6039e692d41984eec0f096d66755bed77147f824 Mon Sep 17 00:00:00 2001 From: "Kyle J. Kemp" Date: Wed, 11 Sep 2024 12:59:25 -0500 Subject: [PATCH] store resources in a common dir, not with the app --- app/helpers/constants.ts | 2 +- app/ipc.ts | 4 ++++ src/app/services/electron.service.ts | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/constants.ts b/app/helpers/constants.ts index db5cae6..206c243 100644 --- a/app/helpers/constants.ts +++ b/app/helpers/constants.ts @@ -1,3 +1,3 @@ import { app } from 'electron'; -export const baseUrl = app.getAppPath(); +export const baseUrl = `${app.getPath('appData')}/lotrmodtoolkit`; diff --git a/app/ipc.ts b/app/ipc.ts index f38a094..e9bd1e6 100644 --- a/app/ipc.ts +++ b/app/ipc.ts @@ -65,6 +65,10 @@ export async function watchMaps(sendToUI: SendToUI) { export function setupIPC(sendToUI: SendToUI) { watchMaps(sendToUI); + ipcMain.on('GET_VERSION', async () => { + sendToUI('version', require('./package.json').version); + }); + ipcMain.on('UPDATE_RESOURCES', async () => { try { sendToUI('notify', { type: 'info', text: 'Updating resources...' }); diff --git a/src/app/services/electron.service.ts b/src/app/services/electron.service.ts index 1f165ab..e000ad1 100644 --- a/src/app/services/electron.service.ts +++ b/src/app/services/electron.service.ts @@ -103,6 +103,8 @@ export class ElectronService { this.isLoaded.set(true); this.isFirstLoad.set(false); + this.send('GET_VERSION'); + this.requestAllJSON(); tryEnsureMaps(); });