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:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user