From 84f572fa88aba7834552f0deb60d74a03e109125 Mon Sep 17 00:00:00 2001 From: Bijin A B Date: Sat, 27 Dec 2025 00:17:14 +0530 Subject: [PATCH] chore: fix minor runtime warnings (#6518) --- packages/bruno-electron/src/store/preferences.js | 8 ++++---- packages/bruno-electron/src/utils/transformBrunoConfig.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/bruno-electron/src/store/preferences.js b/packages/bruno-electron/src/store/preferences.js index 9940f40b9..7673fdf0f 100644 --- a/packages/bruno-electron/src/store/preferences.js +++ b/packages/bruno-electron/src/store/preferences.js @@ -125,10 +125,10 @@ class PreferencesStore { // Migrate proxy configuration from old formats to new format const proxyMigrated = get(preferences, '_migrations.proxyConfigFormat', false); if (!proxyMigrated && preferences?.proxy) { - const proxy = preferences.proxy; + const proxy = preferences.proxy || {}; // Check if this is an old format that needs migration - const hasOldFormat = 'enabled' in proxy || 'mode' in proxy; + const hasOldFormat = proxy.hasOwnProperty('enabled') || proxy.hasOwnProperty('mode'); if (hasOldFormat) { let newProxy = { @@ -146,10 +146,10 @@ class PreferencesStore { }; // Handle old format 1: enabled (boolean) - if ('enabled' in proxy && typeof proxy.enabled === 'boolean') { + if (proxy.hasOwnProperty('enabled') && typeof proxy.enabled === 'boolean') { newProxy.disabled = !proxy.enabled; newProxy.inherit = false; - } else if ('mode' in proxy) { + } else if (proxy.hasOwnProperty('mode')) { // Handle old format 2: mode ('off' | 'on' | 'system') if (proxy.mode === 'off') { newProxy.disabled = true; diff --git a/packages/bruno-electron/src/utils/transformBrunoConfig.js b/packages/bruno-electron/src/utils/transformBrunoConfig.js index 7d1087c18..43a5e21d3 100644 --- a/packages/bruno-electron/src/utils/transformBrunoConfig.js +++ b/packages/bruno-electron/src/utils/transformBrunoConfig.js @@ -76,10 +76,10 @@ async function transformBrunoConfigAfterRead(brunoConfig, collectionPathname) { // Migrate proxy configuration from old format to new format if (brunoConfig.proxy) { - const proxy = brunoConfig.proxy; + const proxy = brunoConfig.proxy || {}; // Check if this is an old format (has 'enabled' property) - if ('enabled' in proxy) { + if (proxy.hasOwnProperty('enabled')) { const enabled = proxy.enabled; let newProxy = {