Skip to content

Commit

Permalink
Provide CLI flag --no-update
Browse files Browse the repository at this point in the history
Useful for testing an installed snapshot version
  • Loading branch information
tadaskay committed Apr 3, 2022
1 parent 7fb88c4 commit 74bb69f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/main/cliFlags.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Copyright (c) 2022 BlockDev AG
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
export const cliFlags = {
NO_UPDATE: "no-update",
}
7 changes: 6 additions & 1 deletion src/main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { supervisor } from "./node/supervisor"
import { createMenu } from "./menu"
import { mysteriumNode } from "./node/mysteriumNode"
import { tequila } from "./node/tequila"
import { cliFlags } from "./cliFlags"

initializeSentry()

Expand Down Expand Up @@ -244,7 +245,11 @@ ipcMain.on(MainIpcListenChannels.OpenCardinityPaymentWindow, async (event: IpcMa
})

ipcMain.on(MainIpcListenChannels.Update, () => {
autoUpdater.checkForUpdates()
if (app.commandLine.hasSwitch(cliFlags.NO_UPDATE)) {
mainWindow?.webContents.send(WebIpcListenChannels.UpdateNotAvailable)
} else {
autoUpdater.checkForUpdates()
}
})
ipcMain.on(MainIpcListenChannels.MinimizeWindow, () => {
mainWindow?.minimize()
Expand Down

0 comments on commit 74bb69f

Please sign in to comment.