feat(tasks): migrate task store from localStorage to SQLite backend
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import { tasks, addTask, completeTask, uncompleteTask, deleteTask } from '$lib/stores/page.svelte.js';
|
||||
import { getTasks, createTask, completeTask, deleteTask } from '$lib/stores/tasks.svelte.js';
|
||||
const tasks = getTasks();
|
||||
import { ChevronDown } from 'lucide-svelte';
|
||||
|
||||
let { wipLimit = 3 } = $props();
|
||||
@@ -12,10 +13,10 @@
|
||||
let overflowTasks = $derived(activeTasks.slice(wipLimit));
|
||||
let hasOverflow = $derived(overflowTasks.length > 0);
|
||||
|
||||
function handleAdd() {
|
||||
async function handleAdd() {
|
||||
const text = newTaskText.trim();
|
||||
if (!text) return;
|
||||
addTask({ text, bucket: 'inbox' });
|
||||
await createTask(text, { bucket: 'inbox' });
|
||||
newTaskText = '';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user