Browse Source

minor change

master
Gregor Wüst 4 years ago
parent
commit
20287ddfbc
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      scripts/notes_app.js

+ 10
- 5
scripts/notes_app.js View File

@@ -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);
}

Loading…
Cancel
Save