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

@ -353,6 +353,8 @@ async function createMainWindow() {
icon, icon,
width: windowSize.width, width: windowSize.width,
height: windowSize.height, height: windowSize.height,
minWidth: 325,
minHeight: 425,
backgroundColor: '#000', backgroundColor: '#000',
show: false, show: false,
webPreferences: { webPreferences: {
@ -949,8 +951,7 @@ function removeContentSecurityPolicy(
betterSession.webRequest.setResolver( betterSession.webRequest.setResolver(
'onHeadersReceived', 'onHeadersReceived',
async (listeners) => { async (listeners) => {
return listeners.reduce( return listeners.reduce(async (accumulator, listener) => {
async (accumulator, listener) => {
const acc = await accumulator; const acc = await accumulator;
if (acc.cancel) { if (acc.cancel) {
return acc; return acc;
@ -958,9 +959,7 @@ function removeContentSecurityPolicy(
const result = await listener.apply(); const result = await listener.apply();
return { ...accumulator, ...result }; return { ...accumulator, ...result };
}, }, Promise.resolve({ cancel: false }));
Promise.resolve({ cancel: false }),
);
}, },
); );
} }