chore: fix minor runtime warnings (#6518)

This commit is contained in:
Bijin A B
2025-12-27 00:17:14 +05:30
committed by GitHub
parent faec95f623
commit 84f572fa88
2 changed files with 6 additions and 6 deletions

View File

@@ -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;

View File

@@ -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 = {