Skip to content

Commit

Permalink
✨ Add priority sort on work experience
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouby committed Feb 5, 2024
1 parent 96f406b commit da1b05d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,12 @@ <h5 class="card-title">${data.name}</h5>
const querySnapshot = await getDocs(collection(db, "work_experience"));

const docs = querySnapshot.docs.sort((a, b) => {
const pA = a.data().tags.includes("Flutter");
const pB = b.data().tags.includes("Flutter");
const pA = a.data().priority;
const pB = b.data().priority;

if (pA && !pB) {
if (pA < pB) {
return -1;
} else if (!pA && pB) {
} else if (pA > pB) {
return 1;
}

Expand Down

0 comments on commit da1b05d

Please sign in to comment.