From 63d7ac5b95f071ceeb52f885e7449b606dbe54e8 Mon Sep 17 00:00:00 2001 From: Andrew Shulaev Date: Wed, 20 Apr 2022 11:12:57 +0100 Subject: Simplify the code window.localStorage.getItem already returns a value of type string|null, the only time the typeof check would be false is on `null` value, assigning which to this.recordTargetOS is done anyway on a separate line. Change-Id: Ia5a1ddd5ede42f7552a4ad38cdbe02345f177cbc --- ui/src/frontend/record_config.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ui/src/frontend/record_config.ts b/ui/src/frontend/record_config.ts index 847a27085..a200b4734 100644 --- a/ui/src/frontend/record_config.ts +++ b/ui/src/frontend/record_config.ts @@ -195,12 +195,8 @@ export class RecordTargetStore { recordTargetOS: string|null; constructor() { - this.recordTargetOS = null; - const savedTarget = + this.recordTargetOS = window.localStorage.getItem(LOCAL_STORAGE_RECORD_TARGET_OS_KEY); - if (typeof savedTarget === 'string') { - this.recordTargetOS = savedTarget; - } } get(): string|null { -- cgit v1.2.3