fix: tasks filters not applied on tab re-entry (closes #49)
render() always fetched /tasks without query params, so active filter chips appeared selected but all tasks were shown after navigating away and back. Fixed by building the same filter query in render() that loadTasks() uses, keeping both parallel fetches and correct filtering. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1163,10 +1163,16 @@ export async function render(container, { user }) {
|
||||
|
||||
if (window.lucide) window.lucide.createIcons();
|
||||
|
||||
// Daten laden
|
||||
// Daten laden (Filter-State aus vorheriger Session berücksichtigen)
|
||||
try {
|
||||
const params = new URLSearchParams();
|
||||
if (state.filters.status) params.set('status', state.filters.status);
|
||||
if (state.filters.priority) params.set('priority', state.filters.priority);
|
||||
if (state.filters.assigned_to) params.set('assigned_to', state.filters.assigned_to);
|
||||
const query = params.toString() ? `?${params}` : '';
|
||||
|
||||
const [tasksData, metaData] = await Promise.all([
|
||||
api.get('/tasks'),
|
||||
api.get(`/tasks${query}`),
|
||||
api.get('/tasks/meta/options'),
|
||||
]);
|
||||
state.tasks = tasksData.data ?? [];
|
||||
|
||||
Reference in New Issue
Block a user