From be3a4a4e918cbaef44891c6c1ffb3f5582df8dce Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Sat, 8 Feb 2020 20:08:34 -0500 Subject: [PATCH] Added support for old format. --- src/config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/config.ts b/src/config.ts index 411c9732..b2eda3be 100644 --- a/src/config.ts +++ b/src/config.ts @@ -148,6 +148,15 @@ function decodeStoredItem(id: string, data) { console.error("Failed to parse SBMap: "+ id); } } + + // This is the old format for SBMap (a JSON string) + if (typeof data === "string") { + let str = JSON.parse(data); + + if(Array.isArray(data)) { + return new SBMap(id, str) + } + } // If all else fails, return the data return data;