mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
feat(ios): add intelligents button (#9281)
Co-authored-by: 砍砍 <git@qaq.wiki>
This commit is contained in:
@@ -10,6 +10,7 @@ import { PageDetailEditor } from '@affine/core/components/page-detail-editor';
|
||||
import { DetailPageWrapper } from '@affine/core/desktop/pages/workspace/detail-page/detail-page-wrapper';
|
||||
import { PageHeader } from '@affine/core/mobile/components';
|
||||
import { useGlobalEvent } from '@affine/core/mobile/hooks/use-global-events';
|
||||
import { AIButtonService } from '@affine/core/modules/ai-button';
|
||||
import { DocService } from '@affine/core/modules/doc';
|
||||
import { DocDisplayMetaService } from '@affine/core/modules/doc-display-meta';
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
@@ -57,6 +58,7 @@ const DetailPageImpl = () => {
|
||||
workspaceService,
|
||||
globalContextService,
|
||||
featureFlagService,
|
||||
aIButtonService,
|
||||
} = useServices({
|
||||
WorkbenchService,
|
||||
ViewService,
|
||||
@@ -65,6 +67,7 @@ const DetailPageImpl = () => {
|
||||
WorkspaceService,
|
||||
GlobalContextService,
|
||||
FeatureFlagService,
|
||||
AIButtonService,
|
||||
});
|
||||
const editor = editorService.editor;
|
||||
const workspace = workspaceService.workspace;
|
||||
@@ -124,6 +127,14 @@ const DetailPageImpl = () => {
|
||||
enableEdgelessEditing,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
aIButtonService.presentAIButton(true);
|
||||
|
||||
return () => {
|
||||
aIButtonService.presentAIButton(false);
|
||||
};
|
||||
}, [aIButtonService]);
|
||||
|
||||
useEffect(() => {
|
||||
globalContext.isTrashDoc.set(!!isInTrash);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user