feat(user): improve user data handling with async provider

This commit is contained in:
cogwheel0
2025-11-27 21:41:32 +05:30
parent de18f1463c
commit 0c140580f5
3 changed files with 19 additions and 3 deletions

View File

@@ -41,7 +41,12 @@ class ProfilePage extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final user = ref.watch(currentUserProvider2);
final authUser = ref.watch(currentUserProvider2);
final asyncUser = ref.watch(currentUserProvider);
final user = asyncUser.maybeWhen(
data: (value) => value ?? authUser,
orElse: () => authUser,
);
final isAuthLoading = ref.watch(isAuthLoadingProvider2);
final api = ref.watch(apiServiceProvider);