From 0032f408e65f424f3370325ef0e22cb6c7e3c834 Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 31 Jul 2024 20:44:39 +0100 Subject: [PATCH] Moved core config out of `saveProfile()` into its own class-level property --- project/src/servers/SaveServer.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/project/src/servers/SaveServer.ts b/project/src/servers/SaveServer.ts index 8d7d9d86..ec17071a 100644 --- a/project/src/servers/SaveServer.ts +++ b/project/src/servers/SaveServer.ts @@ -18,6 +18,8 @@ export class SaveServer { protected onBeforeSaveCallbacks = {}; protected saveMd5 = {}; + protected coreConfig: ICoreConfig; + constructor( @inject("VFS") protected vfs: VFS, @injectAll("SaveLoadRouter") protected saveLoadRouters: SaveLoadRouter[], @@ -26,7 +28,9 @@ export class SaveServer { @inject("LocalisationService") protected localisationService: LocalisationService, @inject("PrimaryLogger") protected logger: ILogger, @inject("ConfigServer") protected configServer: ConfigServer, - ) {} + ) { + this.coreConfig = this.configServer.getConfig(ConfigTypes.CORE); + } /** * Add callback to occur prior to saving profile changes @@ -194,7 +198,7 @@ export class SaveServer { const start = performance.now(); const jsonProfile = this.jsonUtil.serialize( this.profiles[sessionID], - !this.configServer.getConfig(ConfigTypes.CORE).features.compressProfile, + !this.coreConfig.features.compressProfile, ); const fmd5 = this.hashUtil.generateMd5ForData(jsonProfile); if (typeof this.saveMd5[sessionID] !== "string" || this.saveMd5[sessionID] !== fmd5) {