Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): hide start-with-ai if service feature is not enabled (#11633)

yoyoyohamapi9c6d94f597d3
diff --git a/packages/frontend/core/src/blocksuite/block-suite-editor/starter-bar.tsx b/packages/frontend/core/src/blocksuite/block-suite-editor/starter-bar.tsx
index 7a549aa19d..64af761413 100644
--- a/packages/frontend/core/src/blocksuite/block-suite-editor/starter-bar.tsx
+++ b/packages/frontend/core/src/blocksuite/block-suite-editor/starter-bar.tsx
@@ -3,9 +3,9 @@ import {
handleInlineAskAIAction,
pageAIGroups,
} from '@affine/core/blocksuite/ai';
+import { useEnableAI } from '@affine/core/components/hooks/affine/use-enable-ai';
import { DocsService } from '@affine/core/modules/doc';
import { EditorService } from '@affine/core/modules/editor';
-import { FeatureFlagService } from '@affine/core/modules/feature-flag';
import { TemplateDocService } from '@affine/core/modules/template-doc';
import {
TemplateListMenu,
@@ -59,7 +59,6 @@ const StarterBarNotEmpty = ({ doc }: { doc: Store }) => {
const t = useI18n();
const templateDocService = useService(TemplateDocService);
- const featureFlagService = useService(FeatureFlagService);
const docsService = useService(DocsService);
const editorService = useService(EditorService);
@@ -71,7 +70,7 @@ const StarterBarNotEmpty = ({ doc }: { doc: Store }) => {
[doc.id, templateDocService.list]
)
);
- const enableAI = useLiveData(featureFlagService.flags.enable_ai.$);
+ const enableAI = useEnableAI();
const handleSelectTemplate = useAsyncCallback(
async (templateId: string) => {