Skip to content

Commit

Permalink
bug fixed: projects shuffling not working when specific category is s…
Browse files Browse the repository at this point in the history
…elected
  • Loading branch information
blahkheart committed Aug 16, 2023
1 parent 9d1445a commit 7c8dab8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nextjs/components/projects/AllProjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Pagination from "~~/components/lists/Pagination";
import Card from "~~/components/projects/Card";
import { ProjectDocument } from "~~/models/Project";


interface Props {
projects: ProjectDocument[];
}
Expand All @@ -29,7 +30,7 @@ const AllProjects: React.FC<Props> = ({ projects }) => {
useEffect(() => {
function filterProjects() {
const _filteredProjects =
selectedCategory === "all" ? allProjects : projects.filter(project => project.category === selectedCategory);
selectedCategory === "all" ? allProjects : allProjects.filter(project => project.category === selectedCategory);
setFilteredProjects(_filteredProjects);
}
filterProjects();
Expand Down Expand Up @@ -69,4 +70,4 @@ const AllProjects: React.FC<Props> = ({ projects }) => {
);
};

export default AllProjects;
export default AllProjects;

0 comments on commit 7c8dab8

Please sign in to comment.