feat: store options in cookies
TS Lint / Oxlint (push) Successful in 44s
TS Lint / TypeScript (push) Successful in 49s
TS Lint / ESLint (push) Successful in 52s

This commit is contained in:
2026-07-12 17:46:21 +02:00
parent d21a829f6b
commit d969b9e21b
4 changed files with 74 additions and 20 deletions
+7 -5
View File
@@ -6,15 +6,17 @@ import { CirclePlus } from "@lucide/vue";
import TaskItem from "@/components/TaskItem.vue";
import { taskCompleted, sortTasks } from "@/lib/tasks";
import { SortType } from "@/enums";
import { booleanCookieRef, enumCookieRef } from "@/lib/cookies";
const taskInput = ref<string>("");
const tasks = ref<Task[]>([]);
const list = ref<string>("test");
const sortType = ref<SortType>(SortType.RESET_DATE);
const sortReverse = ref<boolean>(false);
const showLastChecked = ref<boolean>(false);
const showNextReset = ref<boolean>(false);
const separateCompleted = ref<boolean>(false);
const sortType = enumCookieRef<SortType>("toutDouxSortType", SortType.CREATED_AT);
const sortReverse = booleanCookieRef("toutDouxSortReverse", false);
const showLastChecked = booleanCookieRef("toutDouxShowLastChecked", false);
const showNextReset = booleanCookieRef("toutDouxShowNextReset", false);
const separateCompleted = booleanCookieRef("toutDouxSeparateCompleted", false);
const hasCompleted = computed<boolean>(() => tasks.value.some(taskCompleted));