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

@@ -1478,7 +1478,12 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
Widget _buildBottomSection(BuildContext context) {
final theme = context.conduitTheme;
final sidebarTheme = context.sidebarTheme;
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 api = ref.watch(apiServiceProvider);
String initialFor(String name) {