From 6e438881875c5c846b8ec5f52d6a784f98d52af4 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Sun, 22 Feb 2026 11:26:30 -0500 Subject: [PATCH] fix: Correctly map staff ID from `session.staff.id` and assign `StaffSession.ownerId` from `s.ownerId`. --- .../data_connect/lib/src/services/data_connect_service.dart | 6 +++--- .../shifts/lib/src/presentation/pages/shifts_page.dart | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/mobile/packages/data_connect/lib/src/services/data_connect_service.dart b/apps/mobile/packages/data_connect/lib/src/services/data_connect_service.dart index d72a48f0..476d39f8 100644 --- a/apps/mobile/packages/data_connect/lib/src/services/data_connect_service.dart +++ b/apps/mobile/packages/data_connect/lib/src/services/data_connect_service.dart @@ -78,14 +78,14 @@ class DataConnectService with DataErrorHandler, SessionHandlerMixin { /// Helper to get the current staff ID from the session. Future getStaffId() async { - String? staffId = dc.StaffSessionStore.instance.session?.ownerId; + String? staffId = dc.StaffSessionStore.instance.session?.staff?.id; if (staffId == null || staffId.isEmpty) { // Attempt to recover session if user is signed in final user = auth.currentUser; if (user != null) { await _loadSession(user.uid); - staffId = dc.StaffSessionStore.instance.session?.ownerId; + staffId = dc.StaffSessionStore.instance.session?.staff?.id; } } @@ -129,7 +129,7 @@ class DataConnectService with DataErrorHandler, SessionHandlerMixin { final s = response.data.staffs.first; dc.StaffSessionStore.instance.setSession( dc.StaffSession( - ownerId: s.id, + ownerId: s.ownerId, staff: domain.Staff( id: s.id, authProviderId: s.userId, diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shifts_page.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shifts_page.dart index d803a199..b515c21f 100644 --- a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shifts_page.dart +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/pages/shifts_page.dart @@ -117,7 +117,6 @@ class _ShiftsPageState extends State { // Note: Calendar logic moved to MyShiftsTab return Scaffold( - backgroundColor: UiColors.background, body: Column( children: [ // Header (Blue)