From c5bc4c4dcd5ff34c5a99f18311df3a54f3017d4a Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Sat, 16 May 2020 21:26:10 +0200 Subject: [PATCH] fix check for string exist Signed-off-by: Tilman Vatteroth --- src/utils/historyUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/historyUtils.ts b/src/utils/historyUtils.ts index b970cf40e..7dce931df 100644 --- a/src/utils/historyUtils.ts +++ b/src/utils/historyUtils.ts @@ -41,7 +41,7 @@ export function loadHistoryFromLocalStore(): HistoryEntry[] { // if localStorage["history"] is empty we check the old localStorage["notehistory"] // and convert it to the new format const oldHistoryJsonString = window.localStorage.getItem("notehistory") - const oldHistory = oldHistoryJsonString ? JSON.parse(JSON.parse(oldHistoryJsonString)) : []; + const oldHistory = !!oldHistoryJsonString ? JSON.parse(JSON.parse(oldHistoryJsonString)) : []; return oldHistory.map((entry: OldHistoryEntry) => { return { id: entry.id,