From 27eb8eb9c39de17d97aaceb6a8c9d253f6d548d8 Mon Sep 17 00:00:00 2001 From: grossmj Date: Mon, 23 Dec 2024 15:07:09 +0700 Subject: [PATCH] Fix interface labels are not persistant --- src/app/services/mapsettings.service.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/app/services/mapsettings.service.ts b/src/app/services/mapsettings.service.ts index 7abf7eb6..509bddc8 100644 --- a/src/app/services/mapsettings.service.ts +++ b/src/app/services/mapsettings.service.ts @@ -37,6 +37,12 @@ export class MapSettingsService { } else { localStorage.setItem('openReadme', 'false'); } + + if (localStorage.getItem('showInterfaceLabels')) { + this.showInterfaceLabels = localStorage.getItem('showInterfaceLabels') === 'true' ? true : false; + } else { + localStorage.setItem('showInterfaceLabels', 'true'); + } } public getSymbolScaling(): boolean { @@ -78,6 +84,12 @@ export class MapSettingsService { toggleShowInterfaceLabels(value: boolean) { this.showInterfaceLabels = value; + localStorage.removeItem('showInterfaceLabels'); + if (value) { + localStorage.setItem('showInterfaceLabels', 'true'); + } else { + localStorage.setItem('showInterfaceLabels', 'false'); + } } toggleIntegrateInterfaceLabels(value: boolean) {