diff --git a/src/app/services/services.module.ts b/src/app/services/services.module.ts index 1c7db74812..6ae5982159 100644 --- a/src/app/services/services.module.ts +++ b/src/app/services/services.module.ts @@ -78,7 +78,7 @@ const stateService = new StateService(); const broadcasterService = new BroadcasterService(); const messagingService = new BroadcasterMessagingService(broadcasterService); const platformUtilsService = new WebPlatformUtilsService(i18nService); -const storageService: StorageServiceAbstraction = new HtmlStorageService(); +const storageService: StorageServiceAbstraction = new HtmlStorageService(platformUtilsService); const secureStorageService: StorageServiceAbstraction = new MemoryStorageService(); const cryptoFunctionService: CryptoFunctionServiceAbstraction = new WebCryptoFunctionService(window, platformUtilsService); diff --git a/src/services/htmlStorage.service.ts b/src/services/htmlStorage.service.ts index 89155b7b63..4d83238acc 100644 --- a/src/services/htmlStorage.service.ts +++ b/src/services/htmlStorage.service.ts @@ -1,3 +1,4 @@ +import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; import { StorageService } from 'jslib/abstractions/storage.service'; import { ConstantsService } from 'jslib/services'; @@ -7,9 +8,11 @@ export class HtmlStorageService implements StorageService { ConstantsService.localeKey, ConstantsService.lockOptionKey]); private localStorageStartsWithKeys = ['twoFactorToken_']; + constructor(private platformUtilsService: PlatformUtilsService) { } + async init() { const lockOption = await this.get(ConstantsService.lockOptionKey); - if (lockOption == null) { + if (lockOption == null && !this.platformUtilsService.isDev()) { await this.save(ConstantsService.lockOptionKey, 15); } }