diff --git a/packages/frontend/mobile/src/pages/workspace/detail/mobile-detail-page.tsx b/packages/frontend/mobile/src/pages/workspace/detail/mobile-detail-page.tsx index 52c4cbf43a..01cfb66e05 100644 --- a/packages/frontend/mobile/src/pages/workspace/detail/mobile-detail-page.tsx +++ b/packages/frontend/mobile/src/pages/workspace/detail/mobile-detail-page.tsx @@ -21,7 +21,6 @@ import { } from '@blocksuite/blocks'; import { DisposableGroup } from '@blocksuite/global/utils'; import { type AffineEditorContainer } from '@blocksuite/presets'; -import type { Doc as BlockSuiteDoc } from '@blocksuite/store'; import { DocService, FrameworkScope, @@ -106,7 +105,7 @@ const DetailPageImpl = () => { usePageDocumentTitle(title); const onLoad = useCallback( - (_bsPage: BlockSuiteDoc, editorContainer: AffineEditorContainer) => { + (editorContainer: AffineEditorContainer) => { // blocksuite editor host const editorHost = editorContainer.host; @@ -191,11 +190,7 @@ const DetailPageImpl = () => { className={styles.journalIconButton} /> )} - + diff --git a/packages/frontend/mobile/src/pages/workspace/index.tsx b/packages/frontend/mobile/src/pages/workspace/index.tsx index 71c74a41dd..dc3df4f290 100644 --- a/packages/frontend/mobile/src/pages/workspace/index.tsx +++ b/packages/frontend/mobile/src/pages/workspace/index.tsx @@ -126,7 +126,7 @@ export const Component = () => { if (workspaceNotFound) { if ( detailDocRoute /* */ && - environment.isBrowser /* only browser has share page */ + environment.isDesktopEdition /* only browser has share page */ ) { return
TODO: share page
; } diff --git a/packages/frontend/mobile/src/pages/workspace/layout.tsx b/packages/frontend/mobile/src/pages/workspace/layout.tsx index 5f79fd9809..c943395ac8 100644 --- a/packages/frontend/mobile/src/pages/workspace/layout.tsx +++ b/packages/frontend/mobile/src/pages/workspace/layout.tsx @@ -19,6 +19,22 @@ import { import { MobileCurrentWorkspaceModals } from '../../provider/model-provider'; +// TODO(@forehalo): reuse the global context with [core/electron] +declare global { + /** + * @internal debug only + */ + // eslint-disable-next-line no-var + var currentWorkspace: Workspace | undefined; + // eslint-disable-next-line no-var + var exportWorkspaceSnapshot: (docs?: string[]) => Promise; + // eslint-disable-next-line no-var + var importWorkspaceSnapshot: () => Promise; + interface WindowEventMap { + 'affine:workspace:change': CustomEvent<{ id: string }>; + } +} + export const WorkspaceLayout = ({ meta, children, diff --git a/tsconfig.json b/tsconfig.json index 9b7a7ee952..2d2bfe28df 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -97,6 +97,9 @@ { "path": "./packages/frontend/web" }, + { + "path": "./packages/frontend/mobile" + }, { "path": "./packages/frontend/electron/tsconfig.test.json" },