this repo has no description

feat: Simplify profile fetching logic in ExplorePage by removing redundant asyncProfile checks

+4 -10
+4 -10
lib/screens/explore_page.dart
··· 6 6 import 'package:grain/app_icons.dart'; 7 7 import 'package:grain/models/profile.dart'; 8 8 import 'package:grain/providers/profile_provider.dart'; 9 + import 'package:grain/screens/profile_page.dart'; 9 10 import 'package:grain/widgets/app_image.dart'; 10 11 import 'package:grain/widgets/plain_text_field.dart'; 11 12 import 'package:shared_preferences/shared_preferences.dart'; 12 - 13 - import 'profile_page.dart'; 14 13 15 14 class ExplorePage extends ConsumerStatefulWidget { 16 15 const ExplorePage({super.key}); ··· 41 40 final profiles = <Profile>[]; 42 41 for (final did in dids) { 43 42 try { 44 - final asyncProfile = ref.watch(profileNotifierProvider(did)); 45 - if (asyncProfile.hasValue && asyncProfile.value != null) { 46 - profiles.add(asyncProfile.value!.profile); 47 - } else { 48 - final profileWithGalleries = await ref.refresh(profileNotifierProvider(did).future); 49 - if (profileWithGalleries != null) { 50 - profiles.add(profileWithGalleries.profile); 51 - } 43 + final profileWithGalleries = await ref.read(profileNotifierProvider(did).future); 44 + if (profileWithGalleries != null) { 45 + profiles.add(profileWithGalleries.profile); 52 46 } 53 47 } catch (_) {} 54 48 }