Merge pull request #3503 from nickofolas/fix/editor-theme-migration

EDITOR: FIX #3502 Editor theme migration crash
This commit is contained in:
hydroflame 2022-04-18 12:45:49 -04:00 committed by GitHub
commit 00628a8c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

@ -118,7 +118,7 @@ export const CONSTANTS: {
LatestUpdate: string;
} = {
VersionString: "1.6.4",
VersionNumber: 14,
VersionNumber: 15,
// Speed (in ms) at which the main loop is updated
_idleSpeed: 200,

@ -23,6 +23,7 @@ import { LocationName } from "./Locations/data/LocationNames";
import { SxProps } from "@mui/system";
import { PlayerObject } from "./PersonObjects/Player/PlayerObject";
import { pushGameSaved } from "./Electron";
import { defaultMonacoTheme } from "./ScriptEditor/ui/themes";
/* SaveObject.js
* Defines the object used to save/load games
@ -394,8 +395,8 @@ function evaluateVersionCompatibility(ver: string | number): void {
delete anyPlayer.resleeves;
}
}
if (ver < 14) {
delete (Settings as any).EditorTheme;
if (ver < 15) {
(Settings as any).EditorTheme = { ...defaultMonacoTheme };
}
}
}