Skip to content

Commit c4314bb

Browse files
committed
feat(challenges): memorize tags in question-list
1 parent fdf706b commit c4314bb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/(app)/challenges/_components/questions-list.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { graphql } from "@/gql";
1111
import { QuestionDifficulty, type QuestionWhereInput } from "@/gql/graphql";
1212
import { getQuestionSolvedStatus, type SolvedStatus } from "@/lib/solved-status";
1313
import { useSuspenseQuery } from "@apollo/client/react";
14+
import { useLocalStorage } from "foxact/use-local-storage";
1415
import FilterSection from "./filter";
1516

1617
export const LIST_QUESTIONS = graphql(`
@@ -33,7 +34,7 @@ export const LIST_QUESTIONS = graphql(`
3334

3435
export default function QuestionsList() {
3536
const [search, setSearch] = useState<string>("");
36-
const [tags, setTags] = useState<TagState>({
37+
const [tags, setTags] = useLocalStorage<TagState>("question-list:tags", {
3738
solvedStatus: ["solved", "unsolved", "not-tried"],
3839
difficulty: [
3940
QuestionDifficulty.Easy,

0 commit comments

Comments
 (0)