File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5050 await Promise .all (secondaryPromises );
5151
5252 if ($schedules [term ].length > 0 && term === $currentTerm ) {
53- currentSchedule .set ($schedules [term ][0 ].id );
53+ // Use handleScheduleChange instead of just setting currentSchedule
54+ // This ensures searchCourseData is properly filtered for the current schedule
55+ handleScheduleChange ($schedules [term ][0 ].id );
5456 }
5557
5658 $ready = true ;
9092 return s ;
9193 });
9294 await persistScheduleOrder ();
95+
96+ // Re-sync searchCourseData with current schedule after reorder
97+ handleScheduleChange ($currentSchedule );
9398 }
9499
95100 async function persistScheduleOrder() {
Original file line number Diff line number Diff line change @@ -502,7 +502,7 @@ function createScheduleEventStore() {
502502 targetId : number
503503 ) : Promise < boolean > => {
504504 const sourceEvents = get ( store ) [ sourceId ] ;
505- if ( sourceEvents === null ) {
505+ if ( sourceEvents == null ) {
506506 console . error ( "Source schedule not found while duplicating" ) ;
507507 return false ;
508508 }
Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ export const load = async ({ locals: { supabase } }) => {
3939 supaPromises . push (
4040 supabase
4141 . from ( "schedules" )
42- . select ( "id, title" )
42+ . select ( "id, title, display_order " )
4343 . eq ( "user_id" , userId )
4444 . eq ( "term" , CURRENT_TERM_ID )
45- . order ( "id " , { ascending : true } )
45+ . order ( "display_order " , { ascending : true } )
4646 ) ;
4747 supaPromises . push (
4848 supabase
You can’t perform that action at this time.
0 commit comments