Added support for old format.

This commit is contained in:
Ajay Ramachandran
2020-02-08 20:08:34 -05:00
parent 1c17464c94
commit be3a4a4e91

View File

@@ -148,6 +148,15 @@ function decodeStoredItem(id: string, data) {
console.error("Failed to parse SBMap: "+ id); 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 // If all else fails, return the data
return data; return data;