Skip to content

Commit

Permalink
fix: utiltiy cli switch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
a0ngo committed Dec 13, 2023
1 parent 50f113b commit 6ea3f00
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/odd-tables-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': patch
---

fix: recovery command-line argument not opens utility properly
9 changes: 5 additions & 4 deletions apps/recovery-utility/main/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ let protocol = deployment.exp
? deployment?.protocol || DEFAULT_PROTOCOL
: DEFAULT_PROTOCOL
: DEFAULT_PROTOCOL;
const relay = app.commandLine.hasSwitch('relay');
const util = app.commandLine.hasSwitch('util');
const relay = app.commandLine.hasSwitch('relay') || process.env.MODE_RELAY === '1';
const util = app.commandLine.hasSwitch('util') || process.env.MODE_UTIL === '1';
resetLogs();
console.log(`Command line specified: relay: ${relay}, util: ${util}.`);
if (relay && util) {
Expand All @@ -43,6 +43,7 @@ if (relay && util) {
protocol = 'RELAY';
} else if (util && !relay) {
protocol = 'UTILITY';
DeploymentStore.set('UTILITY');
}

const { directory, scheme, port } = PROTOCOLS[protocol];
Expand Down Expand Up @@ -85,7 +86,7 @@ export async function createWindow() {
height: 720,
minWidth: 845,
minHeight: 720,
title: 'Fireblocks Recovery Utility',
title: protocol === 'UTILITY' ? 'Fireblocks Recovery Utility' : 'Fireblocks Recovery Relay',
show: false,
webPreferences: {
devTools: true,
Expand All @@ -103,7 +104,7 @@ export async function createWindow() {
loadUrl(win);

win.webContents.on('did-finish-load', () => {
win?.setTitle('Fireblocks Recovery Utility');
win?.setTitle(protocol === 'UTILITY' ? 'Fireblocks Recovery Utility' : 'Fireblocks Recovery Relay');
});

// Disable reload
Expand Down

0 comments on commit 6ea3f00

Please sign in to comment.