Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: publish status error and delete export tab

DiamondThree152093e7d87c
diff --git a/packages/app/src/components/workspace-modal/index.tsx b/packages/app/src/components/workspace-modal/index.tsx
index c0dd2a8bd3..2ce3e50995 100644
--- a/packages/app/src/components/workspace-modal/index.tsx
+++ b/packages/app/src/components/workspace-modal/index.tsx
@@ -20,7 +20,13 @@ import { useRouter } from 'next/router';
import { useTranslation } from '@affine/i18n';
import { LanguageMenu } from './languageMenu';
-import { CloudIcon, LineIcon, LocalIcon, OfflineIcon } from './icons';
+import {
+ CloudIcon,
+ LineIcon,
+ LocalIcon,
+ OfflineIcon,
+ PublishedIcon,
+} from './icons';
import { LoginModal } from '../login-modal';
import { LogoutModal } from '../logout-modal';
interface WorkspaceModalProps {
@@ -120,7 +126,7 @@ export const WorkspaceModal = ({ open, onClose }: WorkspaceModalProps) => {
)}
{item.published && (
<p>
- <PublishIcon fontSize={16} /> Published to Web
+ <PublishedIcon /> Published to Web
</p>
)}
</StyleWorkspaceInfo>
diff --git a/packages/app/src/components/workspace-setting/PublishPage.tsx b/packages/app/src/components/workspace-setting/PublishPage.tsx
index a30b72bdf7..a03749fe98 100644
--- a/packages/app/src/components/workspace-setting/PublishPage.tsx
+++ b/packages/app/src/components/workspace-setting/PublishPage.tsx
@@ -10,7 +10,6 @@ import { useState } from 'react';
import { Button } from '@/ui/button';
import Input from '@/ui/input';
import { toast } from '@/ui/toast';
-// import { useAppState } from '@/providers/app-state-provider3';
import { WorkspaceUnit } from '@affine/datacenter';
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
import { useTranslation } from '@affine/i18n';
@@ -23,6 +22,7 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
const togglePublic = async (flag: boolean) => {
try {
await publishWorkspace(workspace.id.toString(), flag);
+ setLoaded(false);
} catch (e) {
toast('Failed to publish workspace');
}
@@ -67,7 +67,6 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
onClick={async () => {
setLoaded(true);
await togglePublic(true);
- setLoaded(false);
}}
loading={loaded}
type="primary"
@@ -86,7 +85,6 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
onClick={async () => {
setLoaded(true);
await togglePublic(false);
- setLoaded(true);
}}
loading={false}
type="danger"
diff --git a/packages/app/src/components/workspace-setting/SyncPage.tsx b/packages/app/src/components/workspace-setting/SyncPage.tsx
index 6969461a38..69a3df8a67 100644
--- a/packages/app/src/components/workspace-setting/SyncPage.tsx
+++ b/packages/app/src/components/workspace-setting/SyncPage.tsx
@@ -12,8 +12,10 @@ import { WorkspaceUnit } from '@affine/datacenter';
import { Trans, useTranslation } from '@affine/i18n';
import { WorkspaceUnitAvatar } from '@/components/workspace-avatar';
import { EnableWorkspaceButton } from '../enable-workspace';
+import { useAppState } from '@/providers/app-state-provider';
export const SyncPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
const { t } = useTranslation();
+ const { user } = useAppState();
return (
<div>
<StyledPublishContent>
@@ -40,12 +42,19 @@ export const SyncPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
) : (
<>
<StyledPublishExplanation>
- <Trans i18nKey="Sync Description2">
- <code>{{ workspaceName: workspace.name ?? 'Affine' }}</code>
- is Cloud Workspace. All data will be synchronised and saved to
- the AFFiNE
- </Trans>
+ <WorkspaceUnitAvatar
+ size={32}
+ name={workspace.name}
+ workspaceUnit={workspace}
+ style={{ marginRight: '12px' }}
+ />
+ <StyledWorkspaceName>{workspace.name} </StyledWorkspaceName>is
+ Cloud Workspace.
</StyledPublishExplanation>
+ <StyledWorkspaceType>
+ All data will be synchronized and saved to the AFFiNE account{' '}
+ {user?.email}
+ </StyledWorkspaceType>
<StyleAsync>
<Menu
content={
diff --git a/packages/app/src/components/workspace-setting/style.ts b/packages/app/src/components/workspace-setting/style.ts
index dcde665f31..31a19289cc 100644
--- a/packages/app/src/components/workspace-setting/style.ts
+++ b/packages/app/src/components/workspace-setting/style.ts
@@ -146,6 +146,7 @@ export const StyledPublishContent = styled('div')(() => {
return {
display: 'flex',
flexDirection: 'column',
+ flex: 1,
};
});
diff --git a/packages/app/src/pages/workspace/[workspaceId]/setting.tsx b/packages/app/src/pages/workspace/[workspaceId]/setting.tsx
index 11de4aa598..48451dabfd 100644
--- a/packages/app/src/pages/workspace/[workspaceId]/setting.tsx
+++ b/packages/app/src/pages/workspace/[workspaceId]/setting.tsx
@@ -42,11 +42,11 @@ const tabMap: {
name: 'Publish',
panelRender: workspace => <PublishPage workspace={workspace} />,
},
-
- {
- name: 'Export',
- panelRender: workspace => <ExportPage workspace={workspace} />,
- },
+ // TODO: next version will finish this feature
+ // {
+ // name: 'Export',
+ // panelRender: workspace => <ExportPage workspace={workspace} />,
+ // },
];
const WorkspaceSetting = () => {