{
- let notesObj = localStorage.getObj("Notes");
+ setEdit(!edit);
- delete notesObj[params.id];
-
- localStorage.setObj("Notes", notesObj);
+ if (edit) {
+ localStorage.setObj("Notes", notes);
+ }
}}
/>
+ {!edit && (
+ {
+ let notesObj = localStorage.getObj("Notes");
+
+ delete notesObj[params.id];
+
+ localStorage.setObj("Notes", notesObj);
+ }}
+ />
+ )}
)}