refactor: migrate loadConversationProvider family (Phase 3, 1/4)

- Converted FutureProvider.family to @riverpod function
- Provider name unchanged: loadConversationProvider
- Usage: ref.watch(loadConversationProvider(id))
This commit is contained in:
cogwheel0
2025-09-30 14:40:55 +05:30
parent dd96ddccb6
commit a56906f653

View File

@@ -989,10 +989,8 @@ class ActiveConversationNotifier extends Notifier<Conversation?> {
} }
// Provider to load full conversation with messages // Provider to load full conversation with messages
final loadConversationProvider = FutureProvider.family<Conversation, String>(( @riverpod
ref, Future<Conversation> loadConversation(Ref ref, String conversationId) async {
conversationId,
) async {
final api = ref.watch(apiServiceProvider); final api = ref.watch(apiServiceProvider);
if (api == null) { if (api == null) {
throw Exception('No API service available'); throw Exception('No API service available');
@@ -1011,7 +1009,7 @@ final loadConversationProvider = FutureProvider.family<Conversation, String>((
); );
return fullConversation; return fullConversation;
}); }
// Provider to automatically load and set the default model from user settings or OpenWebUI // Provider to automatically load and set the default model from user settings or OpenWebUI
final defaultModelProvider = FutureProvider<Model?>((ref) async { final defaultModelProvider = FutureProvider<Model?>((ref) async {