mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 03:33:06 +08:00
fix(core): hide start-with-ai if service feature is not enabled (#11633)
> CLOSE BS-3062
This commit is contained in:
@@ -3,9 +3,9 @@ import {
|
|||||||
handleInlineAskAIAction,
|
handleInlineAskAIAction,
|
||||||
pageAIGroups,
|
pageAIGroups,
|
||||||
} from '@affine/core/blocksuite/ai';
|
} from '@affine/core/blocksuite/ai';
|
||||||
|
import { useEnableAI } from '@affine/core/components/hooks/affine/use-enable-ai';
|
||||||
import { DocsService } from '@affine/core/modules/doc';
|
import { DocsService } from '@affine/core/modules/doc';
|
||||||
import { EditorService } from '@affine/core/modules/editor';
|
import { EditorService } from '@affine/core/modules/editor';
|
||||||
import { FeatureFlagService } from '@affine/core/modules/feature-flag';
|
|
||||||
import { TemplateDocService } from '@affine/core/modules/template-doc';
|
import { TemplateDocService } from '@affine/core/modules/template-doc';
|
||||||
import {
|
import {
|
||||||
TemplateListMenu,
|
TemplateListMenu,
|
||||||
@@ -59,7 +59,6 @@ const StarterBarNotEmpty = ({ doc }: { doc: Store }) => {
|
|||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
|
|
||||||
const templateDocService = useService(TemplateDocService);
|
const templateDocService = useService(TemplateDocService);
|
||||||
const featureFlagService = useService(FeatureFlagService);
|
|
||||||
const docsService = useService(DocsService);
|
const docsService = useService(DocsService);
|
||||||
const editorService = useService(EditorService);
|
const editorService = useService(EditorService);
|
||||||
|
|
||||||
@@ -71,7 +70,7 @@ const StarterBarNotEmpty = ({ doc }: { doc: Store }) => {
|
|||||||
[doc.id, templateDocService.list]
|
[doc.id, templateDocService.list]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const enableAI = useLiveData(featureFlagService.flags.enable_ai.$);
|
const enableAI = useEnableAI();
|
||||||
|
|
||||||
const handleSelectTemplate = useAsyncCallback(
|
const handleSelectTemplate = useAsyncCallback(
|
||||||
async (templateId: string) => {
|
async (templateId: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user