Skip to content

Commit f23787f

Browse files
committed
chore: fix disable local ai
1 parent a66fba2 commit f23787f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:appflowy/workspace/presentation/settings/pages/setting_ai_view/m
66
import 'package:appflowy/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart';
77
import 'package:flowy_infra/theme_extension.dart';
88
import 'package:flowy_infra_ui/widget/spacing.dart';
9+
import 'package:flutter/foundation.dart';
910
import 'package:flutter/material.dart';
1011

1112
import 'package:appflowy/generated/locale_keys.g.dart';
@@ -147,7 +148,7 @@ class _LocalAIOnBoarding extends StatelessWidget {
147148
child: BlocBuilder<LocalAIOnBoardingBloc, LocalAIOnBoardingState>(
148149
builder: (context, state) {
149150
// Show the local AI settings if the user has purchased the AI Local plan
150-
if (state.isPurchaseAILocal) {
151+
if (kDebugMode || state.isPurchaseAILocal) {
151152
return const LocalAISetting();
152153
} else {
153154
if (member.role.isOwner) {

frontend/rust-lib/flowy-ai/src/local_ai/local_llm_chat.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,12 @@ impl LocalAIController {
326326
.store_preferences
327327
.get_bool(APPFLOWY_LOCAL_AI_CHAT_ENABLED)
328328
.unwrap_or(true);
329-
self.enable_chat_plugin(chat_enabled).await?;
329+
330+
if self.local_ai_resource.is_resource_ready() {
331+
self.enable_chat_plugin(chat_enabled).await?;
332+
}
330333
} else {
331-
self.enable_chat_plugin(false).await?;
334+
let _ = self.enable_chat_plugin(false).await;
332335
}
333336
Ok(enabled)
334337
}

0 commit comments

Comments
 (0)