diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart index 9db418d2..0d05ffa6 100644 --- a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/blocs/shifts/shifts_bloc.dart @@ -79,16 +79,29 @@ class ShiftsBloc extends Bloc emit: emit.call, action: () async { final List days = _getCalendarDaysForOffset(0); - final List myShiftsResult = await getAssignedShifts( - GetAssignedShiftsArguments(start: days.first, end: days.last), - ); + + // Load assigned, pending, and cancelled shifts in parallel. + final List results = await Future.wait(>[ + getAssignedShifts( + GetAssignedShiftsArguments(start: days.first, end: days.last), + ), + getPendingAssignments(), + getCancelledShifts(), + ]); + + final List myShiftsResult = + results[0] as List; + final List pendingResult = + results[1] as List; + final List cancelledResult = + results[2] as List; emit( state.copyWith( status: ShiftsStatus.loaded, myShifts: myShiftsResult, - pendingShifts: const [], - cancelledShifts: const [], + pendingShifts: pendingResult, + cancelledShifts: cancelledResult, availableShifts: const [], historyShifts: const [], availableLoading: false,