Skip to content

Commit

Permalink
store resources in a common dir, not with the app
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Sep 11, 2024
1 parent 155aceb commit 6039e69
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { app } from 'electron';

export const baseUrl = app.getAppPath();
export const baseUrl = `${app.getPath('appData')}/lotrmodtoolkit`;
4 changes: 4 additions & 0 deletions app/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...' });
Expand Down
2 changes: 2 additions & 0 deletions src/app/services/electron.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ export class ElectronService {
this.isLoaded.set(true);
this.isFirstLoad.set(false);

this.send('GET_VERSION');

this.requestAllJSON();
tryEnsureMaps();
});
Expand Down

0 comments on commit 6039e69

Please sign in to comment.