From 2046b253e3c0461da999741c210ce1f092d55a6f Mon Sep 17 00:00:00 2001 From: Ishan Awal <67328850+ishanawal@users.noreply.github.com> Date: Sat, 6 Sep 2025 01:49:16 +0545 Subject: [PATCH] fix: Added Min height and width to the window which doesnt breaks the UI responsiveness (#3602) --- src/index.ts | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/index.ts b/src/index.ts index afd8f992..c3239a6b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -338,8 +338,8 @@ async function createMainWindow() { titleBarStyle: useInlineMenu ? 'hidden' : is.macOS() - ? 'hiddenInset' - : 'default', + ? 'hiddenInset' + : 'default', autoHideMenuBar: config.get('options.hideMenu'), }; @@ -353,6 +353,8 @@ async function createMainWindow() { icon, width: windowSize.width, height: windowSize.height, + minWidth: 325, + minHeight: 425, backgroundColor: '#000', show: false, webPreferences: { @@ -527,8 +529,8 @@ app.once('browser-window-created', (_event, win) => { const updatedUserAgent = is.macOS() ? userAgents.mac : is.windows() - ? userAgents.windows - : userAgents.linux; + ? userAgents.windows + : userAgents.linux; win.webContents.userAgent = updatedUserAgent; app.userAgentFallback = updatedUserAgent; @@ -949,18 +951,15 @@ function removeContentSecurityPolicy( betterSession.webRequest.setResolver( 'onHeadersReceived', async (listeners) => { - return listeners.reduce( - async (accumulator, listener) => { - const acc = await accumulator; - if (acc.cancel) { - return acc; - } + return listeners.reduce(async (accumulator, listener) => { + const acc = await accumulator; + if (acc.cancel) { + return acc; + } - const result = await listener.apply(); - return { ...accumulator, ...result }; - }, - Promise.resolve({ cancel: false }), - ); + const result = await listener.apply(); + return { ...accumulator, ...result }; + }, Promise.resolve({ cancel: false })); }, ); }