Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jsalzer312 committed May 28, 2024
1 parent 62d85fb commit b14846e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ function loadContacts(jsonObject){
let i = 0;
let hide = 1;
let show = 0;
console.log(jsonObject);

if(jsonObject.contacts.length == 0){
document.getElementById("contact-result").innerHTML = "No contacts found";
Expand All @@ -583,16 +584,12 @@ function loadContacts(jsonObject){
toggleElement(row,show);

if(jsonObject.contacts[i].Favorited===1){
console.log("contact-not-fave-"+parseInt(i+1)+" style change to none");
document.getElementById("contact-not-fave-"+parseInt(i+1)).style.display = "none";

document.getElementById("contact-not-fave-"+parseInt(i+1)).style.display = "none";
document.getElementById("contact-fave-"+parseInt(i+1)).style.display = "flex";
console.log(jsonObject.contacts[i].FirstName+"contact is favorite");
}
else if(jsonObject.contacts[i].Favorited===0){
document.getElementById("contact-fave-"+parseInt(i+1)).style.display = "none";
document.getElementById("contact-not-fave-"+parseInt(i+1)).style.display = "flex";
console.log(jsonObject.contacts[i].FirstName+"contact is not a favorite");
}
document.getElementById("contact-first-name-"+parseInt(i+1)).textContent = jsonObject.contacts[i].FirstName;
document.getElementById("contact-last-name-"+parseInt(i+1)).textContent = jsonObject.contacts[i].LastName;
Expand Down

0 comments on commit b14846e

Please sign in to comment.