mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 11:51:30 +00:00
chore: fix minor runtime warnings (#6518)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user