Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandraCherevko committed Apr 3, 2024
1 parent 99245c6 commit c197d2a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/2-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ form.addEventListener('submit', event => {
event.preventDefault();
const savedMessage = JSON.parse(localStorage.getItem(STORAGE_KEY));

if (localStorage.getItem === savedMessage) {
if (savedMessage) {
console.log(savedMessage);
} else if (localStorage.getItem === '') {
} else {
return;
}
event.currentTarget.reset();
Expand Down

0 comments on commit c197d2a

Please sign in to comment.