|
|
@@ -285,6 +285,15 @@ async function removeBrowserItem(id){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function getItemFromStorage(idTmp){ |
|
|
|
return new Promise(resolve => { |
|
|
|
let item = JSON.parse(localStorage.getItem('noteObj'+idTmp)); |
|
|
|
console.log("in promise "+item); |
|
|
|
resolve(item); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function getSavedNote(id){ |
|
|
|
console.log("getSavedNote() "+ id); |
|
|
|
createLoadingSign("", "allNotesDiv"); |
|
|
@@ -294,11 +303,7 @@ async function getSavedNote(id){ |
|
|
|
console.log("id before split " + id); |
|
|
|
let idTmp = id.split("_")[1]; |
|
|
|
console.log("idTmp " +idTmp); |
|
|
|
let item = await new Promise(resolve => { |
|
|
|
let item = JSON.parse(localStorage.getItem('noteObj'+idTmp)); |
|
|
|
console.log("in promise "+item); |
|
|
|
resolve(item); |
|
|
|
}) |
|
|
|
let item = await getItemFromStorage(idTmp); |
|
|
|
console.log(item); |
|
|
|
createFormWithSavedContent(item, idTmp); |
|
|
|
} |