File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/lib/components/WorkBook Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import { run } from ' svelte/legacy' ;
3-
42 import { Breadcrumb , BreadcrumbItem } from ' svelte-5-ui-lib' ;
53
64 import HeadingOne from ' $lib/components/HeadingOne.svelte' ;
4240
4341 const { form, message, errors, enhance } = superFormObject ;
4442
45- let workBookTasksForTable: WorkBookTasksCreate | WorkBookTasksEdit = $state ([]);
46-
47- // HACK: This is a workaround to ensure that the derived state is updated correctly.
48- run (() => {
49- workBookTasksForTable = $form .workBookTasks
43+ let workBookTasksForTable: WorkBookTasksCreate | WorkBookTasksEdit = $derived (
44+ $form .workBookTasks
5045 .map ((workBookTask : WorkBookTaskCreate | WorkBookTaskEdit ) => {
5146 const task = tasksMapByIds .get (workBookTask .taskId );
5247
6560 .filter (
6661 (item : WorkBookTaskCreate | WorkBookTaskEdit ): item is NonNullable <typeof item > =>
6762 item !== null ,
68- );
69- } );
63+ ),
64+ );
7065
7166 const truncateClass = ' min-w-[96px] max-w-[120px] sm:max-w-[300px] lg:max-w-[600px] truncate' ;
7267 const tasks: Tasks = $derived (Array .from (tasksMapByIds .values ()));
You can’t perform that action at this time.
0 commit comments