mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
fix check for string exist
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
aeeb08ea5a
commit
c5bc4c4dcd
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ export function loadHistoryFromLocalStore(): HistoryEntry[] {
|
||||||
// if localStorage["history"] is empty we check the old localStorage["notehistory"]
|
// if localStorage["history"] is empty we check the old localStorage["notehistory"]
|
||||||
// and convert it to the new format
|
// and convert it to the new format
|
||||||
const oldHistoryJsonString = window.localStorage.getItem("notehistory")
|
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 oldHistory.map((entry: OldHistoryEntry) => {
|
||||||
return {
|
return {
|
||||||
id: entry.id,
|
id: entry.id,
|
||||||
|
|
Loading…
Reference in a new issue