Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
fix: remove selected baan
Browse files Browse the repository at this point in the history
  • Loading branch information
D33102 committed Jul 13, 2023
1 parent 47a41a0 commit bf5eccb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/baan-choosing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,15 @@ const BaanChoosing = () => {
</div>
);
});
const isAdded = (other: IBaan) => {
//Check if the baan is selected and will not visualize in Baan list
for (let i: number = 0; i < 3; i++) {
if (selectedBaan[i].id === other.id) return false;
}
return true;
};
const listBaan: ReactNode = baan //convert list of all Baans in RPKM to TSX
.filter((e) => e.name.includes(input)) //Filter when typing the search bar
.filter((e) => e.name.includes(input) && isAdded(e)) //Filter when typing the search bar
.map((e: IBaan) => {
return (
<div
Expand Down

0 comments on commit bf5eccb

Please sign in to comment.