From 9c6d94f597d3acd83770347f32f1bcdf92e2c37f Mon Sep 17 00:00:00 2001 From: yoyoyohamapi <8338436+yoyoyohamapi@users.noreply.github.com> Date: Fri, 11 Apr 2025 08:31:05 +0000 Subject: [PATCH] fix(core): hide start-with-ai if service feature is not enabled (#11633) > CLOSE BS-3062 --- .../core/src/blocksuite/block-suite-editor/starter-bar.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 7a549aa19..64af76141 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) => {