From a9011c54c77aa7c744b46c9bae78388981e8d146 Mon Sep 17 00:00:00 2001 From: Sanji78 <166992508+Sanji78@users.noreply.github.com> Date: Sun, 9 Aug 2026 09:11:13 +0200 Subject: [PATCH] Fix user profile is unavailable with PowerSync --- lib/core/widgets/dashboard/widgets/weight.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/core/widgets/dashboard/widgets/weight.dart b/lib/core/widgets/dashboard/widgets/weight.dart index efe3caf1f..976be228a 100644 --- a/lib/core/widgets/dashboard/widgets/weight.dart +++ b/lib/core/widgets/dashboard/widgets/weight.dart @@ -84,9 +84,12 @@ class DashboardWeightWidget extends ConsumerWidget { } final profile = profileAsync.value; if (profile == null) { - // Loaded successfully but the API returned no profile, treat the same - // way we treat a server error so the user isn't stuck on a spinner. - return _shell(context, const StreamErrorIndicator('User profile is unavailable')); + // The profile stream can legitimately emit null right after login, + // before the local `user_profile` PowerSync bucket has finished its + // first sync (see WeightOverview / NutritionalPlansList, which treat + // this the same way). Keep showing the spinner instead of a + // permanent-looking error; the widget rebuilds once the row lands. + return _shell(context, const BoxedProgressIndicator()); } return _shell(context, _buildContent(context, entriesAsync.value!, profile));