Skip to content

Commit

Permalink
feat(suite): start bridge only (no ui)
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan authored and mroz22 committed Jul 31, 2024
1 parent cab0643 commit 9f2a159
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/suite-desktop-core/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import { getBuildInfo, getComputerInfo } from './libs/info';
import { restartApp, processStatePatch } from './libs/app-utils';
import { clearAppCache, initUserData } from './libs/user-data';
import { initSentry } from './libs/sentry';
import { initModules, mainThreadEmitter } from './modules';
import { Dependencies, initModules, mainThreadEmitter } from './modules';
import { init as initTorModule } from './modules/tor';
import { init as initBridgeModule } from './modules/bridge';
import { createInterceptor } from './libs/request-interceptor';
import { hangDetect } from './hang-detect';
import { Logger } from './libs/logger';
Expand Down Expand Up @@ -124,6 +125,20 @@ const init = async () => {
restartApp();
});

// No UI mode with bridge only
const { wasOpenedAtLogin } = app.getLoginItemSettings();
if (app.commandLine.hasSwitch('bridge-daemon') || wasOpenedAtLogin) {
logger.info('main', 'App is hidden, starting bridge only');
app.dock?.hide(); // hide dock icon on macOS
app.releaseSingleInstanceLock(); // allow user to open new instance with UI
const loadBridgeModule = initBridgeModule({ store } as Dependencies); // bridge module only needs store
if (loadBridgeModule) {
loadBridgeModule(null);
}

return;
}

await app.whenReady();

const buildInfo = getBuildInfo();
Expand Down

0 comments on commit 9f2a159

Please sign in to comment.