mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-10-22 15:21:24 +00:00
just save it always
This commit is contained in:
1 parent
0333c7b2af
commit
8e06b272fa
1 file changed
+2
-11
@@ -23,53 +23,44 @@ export function setDeveloperSettings(settings: DeveloperSettings): void {
|
||||
//region Migration from untyped storage
|
||||
async function migrateOldDeveloperSettings(): Promise<void> {
|
||||
const devSettings = getDeveloperSettings();
|
||||
let mod = false;
|
||||
|
||||
const oldGatewayLogging = localStorage.getItem("logGateway");
|
||||
if (oldGatewayLogging !== null) {
|
||||
devSettings.gatewayLogging = oldGatewayLogging === "true";
|
||||
localStorage.removeItem("logGateway");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
const oldGatewayCompression = localStorage.getItem("gateWayComp");
|
||||
if (oldGatewayCompression !== null) {
|
||||
devSettings.gatewayCompression = oldGatewayCompression !== "false";
|
||||
devSettings.gatewayCompression = oldGatewayCompression === "true";
|
||||
localStorage.removeItem("gateWayComp");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
const oldShowTraces = localStorage.getItem("traces");
|
||||
if (oldShowTraces !== null) {
|
||||
devSettings.showTraces = oldShowTraces === "true";
|
||||
localStorage.removeItem("traces");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
const oldInterceptApiTraces = localStorage.getItem("capTrace");
|
||||
if (oldInterceptApiTraces !== null) {
|
||||
devSettings.interceptApiTraces = oldInterceptApiTraces === "true";
|
||||
localStorage.removeItem("capTrace");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
const oldCacheSourceMaps = localStorage.getItem("isDev");
|
||||
if (oldCacheSourceMaps !== null) {
|
||||
devSettings.cacheSourceMaps = oldCacheSourceMaps === "true";
|
||||
localStorage.removeItem("isDev");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
const oldLogBannedFields = localStorage.getItem("logbad");
|
||||
if (oldLogBannedFields !== null) {
|
||||
devSettings.logBannedFields = oldLogBannedFields === "true";
|
||||
localStorage.removeItem("logbad");
|
||||
mod = true;
|
||||
}
|
||||
|
||||
if (mod) {
|
||||
setDeveloperSettings(devSettings);
|
||||
}
|
||||
setDeveloperSettings(devSettings);
|
||||
}
|
||||
await migrateOldDeveloperSettings();
|
||||
//endregion
|
||||
Reference in new issue
Block a user