Fix Electron Build (#1926)

This commit is contained in:
Shazib Hussain
2023-11-20 18:16:25 +00:00
committed by GitHub
parent 9c6d9ecf0a
commit e6e184c412
5 changed files with 20 additions and 6 deletions

View File

@@ -129,7 +129,9 @@ global.Actual = {
return worker;
},
setTheme: () => {},
setTheme: theme => {
window.__actionsForMenu.saveGlobalPrefs({ theme: theme });
},
};
document.addEventListener('keydown', e => {

View File

@@ -14,10 +14,6 @@ export function handleGlobalEvents(actions, store) {
// to update.
});
global.Actual.setTheme = theme => {
actions.saveGlobalPrefs({ theme });
};
listen('server-error', info => {
actions.addGenericErrorNotification();
});

View File

@@ -407,3 +407,11 @@ ipcMain.on('apply-update', () => {
ipcMain.on('update-menu', (event, isBudgetOpen) => {
updateMenu(isBudgetOpen);
});
ipcMain.on('set-theme', theme => {
let obj = { theme: theme };
clientWin.webContents.executeJavaScript(
`window.__actionsForMenu && window.__actionsForMenu.saveGlobalPrefs(${obj})`,
);
});

View File

@@ -55,5 +55,7 @@ contextBridge.exposeInMainWorld('Actual', {
return socketPromise;
},
setTheme: () => {},
setTheme: theme => {
ipcRenderer.send('set-theme', theme);
},
});

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [Shazib]
---
Fix issue with electron builds being stuck on a blank screen.