fix: preserve bandplan override lookup
This commit is contained in:
@@ -56,16 +56,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// src/core/settings.ts
|
// src/core/settings.ts
|
||||||
var STORAGE_PREFIX2 = "trx_";
|
var STORAGE_PREFIX = "trx_";
|
||||||
function saveSetting(key, value) {
|
function saveSetting(key, value) {
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(`${STORAGE_PREFIX2}${key}`, JSON.stringify(value));
|
localStorage.setItem(`${STORAGE_PREFIX}${key}`, JSON.stringify(value));
|
||||||
} catch {
|
} catch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function loadSetting(key, fallback) {
|
function loadSetting(key, fallback) {
|
||||||
try {
|
try {
|
||||||
const value = localStorage.getItem(`${STORAGE_PREFIX2}${key}`);
|
const value = localStorage.getItem(`${STORAGE_PREFIX}${key}`);
|
||||||
return value === null ? fallback : JSON.parse(value);
|
return value === null ? fallback : JSON.parse(value);
|
||||||
} catch {
|
} catch {
|
||||||
return fallback;
|
return fallback;
|
||||||
@@ -3113,7 +3113,7 @@ ${unsupportedBandSummary()}`;
|
|||||||
}
|
}
|
||||||
if (!_bandplanServerDefaultApplied && typeof update.bandplan_enabled === "boolean" && typeof update.bandplan_region === "string") {
|
if (!_bandplanServerDefaultApplied && typeof update.bandplan_enabled === "boolean" && typeof update.bandplan_region === "string") {
|
||||||
_bandplanServerDefaultApplied = true;
|
_bandplanServerDefaultApplied = true;
|
||||||
const hasUserOverride = localStorage.getItem(STORAGE_PREFIX + "bandplanRegion") !== null;
|
const hasUserOverride = localStorage.getItem("trx_bandplanRegion") !== null;
|
||||||
if (!hasUserOverride) {
|
if (!hasUserOverride) {
|
||||||
const region = update.bandplan_enabled ? update.bandplan_region : "off";
|
const region = update.bandplan_enabled ? update.bandplan_region : "off";
|
||||||
bandplanRegion = region;
|
bandplanRegion = region;
|
||||||
|
|||||||
@@ -3343,7 +3343,7 @@ function render(update) {
|
|||||||
if (!_bandplanServerDefaultApplied && typeof update.bandplan_enabled === "boolean"
|
if (!_bandplanServerDefaultApplied && typeof update.bandplan_enabled === "boolean"
|
||||||
&& typeof update.bandplan_region === "string") {
|
&& typeof update.bandplan_region === "string") {
|
||||||
_bandplanServerDefaultApplied = true;
|
_bandplanServerDefaultApplied = true;
|
||||||
const hasUserOverride = localStorage.getItem(STORAGE_PREFIX + "bandplanRegion") !== null;
|
const hasUserOverride = localStorage.getItem("trx_bandplanRegion") !== null;
|
||||||
if (!hasUserOverride) {
|
if (!hasUserOverride) {
|
||||||
const region = update.bandplan_enabled ? update.bandplan_region : "off";
|
const region = update.bandplan_enabled ? update.bandplan_region : "off";
|
||||||
bandplanRegion = region;
|
bandplanRegion = region;
|
||||||
|
|||||||
Reference in New Issue
Block a user