From 1540d743d89471ce0826f0ec4ff2879697d91556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20V=C3=A1clav=C3=ADk?= Date: Mon, 13 Jan 2025 13:05:45 +0100 Subject: [PATCH] feat(suite): Add parameters for window size (electron) from terminal --- packages/suite-desktop-core/src/app.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/suite-desktop-core/src/app.ts b/packages/suite-desktop-core/src/app.ts index f9f2f6ac2bd..76446c3f3b5 100644 --- a/packages/suite-desktop-core/src/app.ts +++ b/packages/suite-desktop-core/src/app.ts @@ -186,7 +186,12 @@ const init = async () => { const computerInfo = await getComputerInfo(); logger.debug('computer', computerInfo); - const winBounds = store.getWinBounds(); + const widthArg = parseInt(app.commandLine.getSwitchValue('width'), 10); + const heightArg = parseInt(app.commandLine.getSwitchValue('height'), 10); + const winBounds = { + width: !isNaN(widthArg) ? Math.max(widthArg, MIN_WIDTH) : store.getWinBounds().width, + height: !isNaN(heightArg) ? Math.max(heightArg, MIN_HEIGHT) : store.getWinBounds().height, + }; logger.debug('init', `Create Browser Window (${winBounds.width}x${winBounds.height})`); // init modules