fix: Added Min height and width to the window which doesnt breaks the UI responsiveness (#3602)

This commit is contained in:
Ishan Awal
2025-09-06 01:49:16 +05:45
committed by GitHub
parent c068e11fc5
commit 2046b253e3

View File

@ -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 }));
},
);
}