dont set default lock option in dev

This commit is contained in:
Kyle Spearrin 2018-07-27 21:52:36 -04:00
parent 9a70c0e8a7
commit 17ae441c22
2 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -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<number>(ConstantsService.lockOptionKey);
if (lockOption == null) {
if (lockOption == null && !this.platformUtilsService.isDev()) {
await this.save(ConstantsService.lockOptionKey, 15);
}
}