|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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){ |
|
|
async function getSavedNote(id){ |
|
|
console.log("getSavedNote() "+ id); |
|
|
console.log("getSavedNote() "+ id); |
|
|
createLoadingSign("", "allNotesDiv"); |
|
|
createLoadingSign("", "allNotesDiv"); |
|
|
|
|
|
|
|
|
console.log("id before split " + id); |
|
|
console.log("id before split " + id); |
|
|
let idTmp = id.split("_")[1]; |
|
|
let idTmp = id.split("_")[1]; |
|
|
console.log("idTmp " +idTmp); |
|
|
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); |
|
|
console.log(item); |
|
|
createFormWithSavedContent(item, idTmp); |
|
|
createFormWithSavedContent(item, idTmp); |
|
|
} |
|
|
} |