tried to load saved json from local storage using JSON.parse(localStorage.getItem("CanvaData"))
ready() {
console.log("Plugin initialized successfully");
var arr = JSON.parse(localStorage.getItem("CanvaData"));
console.log(arr)
// localStorage.clear();
pdf.loadFromJSON(arr)
},
but as you can see it's throwing SyntaxError: Unexpected end of JSON input
.
how to resolve this issue?
So after investigating for hours i found the issue that causes this.
i saved the json into local storage as a single string
now i changed it to save the data as json to local storage
after that i modified the load from json as the following:
Fixed.