Skip to content

Commit

Permalink
#4.7 Super Recap
Browse files Browse the repository at this point in the history
  • Loading branch information
KwanHoo committed Jan 24, 2023
1 parent a18ba60 commit 4ddf0b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions script3.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function onLoginSubmit(event){
localStorage.setItem(USERNAME_KEY, username);
// greeting.innerText = `Hello ${username}`;
// greeting.classList.remove(HIDDEN_CLASSNAME);
paintGreetings(username);
paintGreetings();

}

Expand All @@ -60,8 +60,9 @@ link.addEventListener("click", handleLinkClick);
const savedUsername = localStorage.getItem(USERNAME_KEY);
console.log(savedUsername);

function paintGreetings(userName){
greeting.innerText = `Hello ${userName}`;
function paintGreetings(){
const username = localStorage.getItem(USERNAME_KEY);
greeting.innerText = `Hello ${username}`;
greeting.classList.remove(HIDDEN_CLASSNAME);
}

Expand All @@ -73,5 +74,5 @@ if(savedUsername === null){
// show the greeting
// greeting.innerText = `Hello ${savedUsername}`;
// greeting.classList.remove(HIDDEN_CLASSNAME);
paintGreetings(savedUsername);
paintGreetings();
}

0 comments on commit 4ddf0b3

Please sign in to comment.