refactor(dashboard): extract settled<T>() helper; fix page.svelte.spec.ts types

Collapses 5x duplicated null-check pattern in the reader fetch branch into
a single typed helper — addresses @Felix review blocker.

Also adds isReader/incompleteDocs/incompleteTotal to page.svelte.spec.ts
baseData so it satisfies the discriminated PageData union introduced by this PR.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-07 22:22:15 +02:00
committed by marcel
parent 1f592958d7
commit c8b1a890be
2 changed files with 15 additions and 39 deletions

View File

@@ -20,6 +20,7 @@ const baseData = {
enabled: true,
createdAt: '2024-01-01T00:00:00Z'
} as User,
isReader: false as const,
canWrite: true,
canAnnotate: false,
canBlogWrite: false,
@@ -31,6 +32,8 @@ const baseData = {
transcriptionDocs: [],
readyDocs: [],
weeklyStats: null,
incompleteDocs: [],
incompleteTotal: 0,
error: null
};