diff --git a/apps/web/src/pages/workspace/[workspaceId]/setting.tsx b/apps/web/src/pages/workspace/[workspaceId]/setting.tsx index 93374c5a26..4dc3afc022 100644 --- a/apps/web/src/pages/workspace/[workspaceId]/setting.tsx +++ b/apps/web/src/pages/workspace/[workspaceId]/setting.tsx @@ -17,6 +17,7 @@ import { MembersPage, PublishPage, ExportPage, + SyncPage, } from '@/components/workspace-setting'; import { SettingsIcon } from '@blocksuite/icons'; import WorkspaceLayout from '@/components/workspace-layout'; @@ -41,10 +42,11 @@ const useTabMap = () => { panelRender: workspace => , }, // TODO: add it back for desktop version - // { - // name: t('Sync'), - // panelRender: workspace => , - // }, + { + id: 'Sync', + name: t('Sync'), + panelRender: workspace => , + }, { id: 'Collaboration', name: t('Collaboration'), @@ -100,6 +102,7 @@ const WorkspaceSetting = () => { const currentWorkspace = useGlobalState( useCallback(store => store.currentDataCenterWorkspace, []) ); + const user = useGlobalState(store => store.user); const { activeTabPanelRender, tabMap, handleTabChange, activeTab } = useTabMap(); @@ -110,6 +113,10 @@ const WorkspaceSetting = () => { width: 0, }); + const shouldHideSyncTab = + currentWorkspace?.owner?.id !== user?.id || + currentWorkspace?.provider === 'local'; + useEffect(() => { const tabButton = document.querySelector( `[data-setting-tab-button="${activeTab}"]` @@ -134,6 +141,9 @@ const WorkspaceSetting = () => { {tabMap.map(({ id, name }) => { + if (shouldHideSyncTab && id === 'Sync') { + return null; + } return (