Deduplicate guest tasks list and restore header icon
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-14 11:17:35 +01:00
parent 03c7b20cae
commit c0193c9581
4 changed files with 45 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ import { getDeviceId } from '../lib/device';
import { FADE_SCALE, FADE_UP, STAGGER_FAST, getMotionContainerProps, getMotionItemProps, prefersReducedMotion } from '../lib/motion';
import PullToRefresh from '../components/PullToRefresh';
import { triggerHaptic } from '../lib/haptics';
import { dedupeTasksById } from '../lib/taskUtils';
interface Task {
id: number;
@@ -133,9 +134,10 @@ export default function TaskPickerPage() {
? payload.tasks
: [];
const entry = { data: taskList, etag: response.headers.get('ETag') };
const uniqueTasks = dedupeTasksById(taskList);
const entry = { data: uniqueTasks, etag: response.headers.get('ETag') };
tasksCacheRef.current.set(cacheKey, entry);
setTasks(taskList);
setTasks(uniqueTasks);
} catch (err) {
console.error('Failed to load tasks', err);
setError(err instanceof Error ? err.message : 'Unbekannter Fehler');