diff --git a/packages/desktop-electron/index.js b/packages/desktop-electron/index.js index 07227d1eb40..188eb12fdae 100644 --- a/packages/desktop-electron/index.js +++ b/packages/desktop-electron/index.js @@ -2,6 +2,7 @@ // (I have no idea why the imports are like this. Not touching them.) const isDev = require('electron-is-dev'); const fs = require('fs'); + require('module').globalPaths.push(__dirname + '/..'); const { diff --git a/packages/desktop-electron/server.js b/packages/desktop-electron/server.js index 0747310123d..82cbacf80a6 100644 --- a/packages/desktop-electron/server.js +++ b/packages/desktop-electron/server.js @@ -9,20 +9,7 @@ function getBackend() { return require('loot-core/lib-dist/bundle.desktop.js'); } -if (process.argv[2] === '--subprocess') { - const isDev = false; +const isDev = false; - // Start the app - getBackend().initApp(isDev); -} else if (process.argv[2] === '--standalone') { - require('source-map-support').install(); - getBackend().initApp(true, 'actual-standalone'); -} else { - const { ipcRenderer } = require('electron'); - const isDev = true; - - ipcRenderer.on('set-socket', (event, { name }) => { - // Start the app - getBackend().initApp(isDev, name); - }); -} +// Start the app +getBackend().initApp(isDev); diff --git a/packages/loot-core/src/client/actions/app.ts b/packages/loot-core/src/client/actions/app.ts index 9383b120491..dac6c7bb5ca 100644 --- a/packages/loot-core/src/client/actions/app.ts +++ b/packages/loot-core/src/client/actions/app.ts @@ -1,4 +1,4 @@ -import { init as initConnection, send } from '../../platform/client/fetch'; +import { send } from '../../platform/client/fetch'; import * as constants from '../constants'; import type { AppState, @@ -15,12 +15,6 @@ export function setAppState(state: Partial): SetAppStateAction { }; } -export function reconnect(connectionName: string) { - return () => { - initConnection(connectionName); - }; -} - export function updateApp() { return async (dispatch: Dispatch) => { global.Actual.applyAppUpdate(); diff --git a/upcoming-release-notes/2190.md b/upcoming-release-notes/2190.md new file mode 100644 index 00000000000..0e78c730bdf --- /dev/null +++ b/upcoming-release-notes/2190.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [MatissJanis] +--- + +electron: move back from WebSockets to IPC for internal communications. This should improve the stability of the desktop app.