Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
chore: emit ready state faster
Richard Shiuee11388491f7a
diff --git a/frontend/appflowy_flutter/lib/ai/service/select_model_bloc.dart b/frontend/appflowy_flutter/lib/ai/service/select_model_bloc.dartindex 46e9b5ef92..c6c6c03ccf 100644--- a/frontend/appflowy_flutter/lib/ai/service/select_model_bloc.dart+++ b/frontend/appflowy_flutter/lib/ai/service/select_model_bloc.dart@@ -36,7 +36,7 @@ class SelectModelBloc extends Bloc<SelectModelEvent, SelectModelState> {SelectModelBloc({required AIModelStateNotifier aiModelStateNotifier,}) : _aiModelStateNotifier = aiModelStateNotifier,- super(SelectModelState.initial()) {+ super(SelectModelState.initial(aiModelStateNotifier)) {on<SelectModelEvent>((event, emit) {event.when(@@ -103,8 +103,11 @@ class SelectModelState with _$SelectModelState {required AiModel? selectedModel,}) = _SelectModelState;- factory SelectModelState.initial() => SelectModelState(- models: [],- selectedModel: null,- );+ factory SelectModelState.initial(AIModelStateNotifier notifier) {+ final (models, selectedModel) = notifier.getAvailableModels();+ return SelectModelState(+ models: models,+ selectedModel: selectedModel,+ );+ }}