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: logout will jump to 404 error

DiamondThree028fdae8b1a9
diff --git a/packages/app/src/components/logout-modal/index.tsx b/packages/app/src/components/logout-modal/index.tsx
index 19b6b04d93..d710b2e451 100644
--- a/packages/app/src/components/logout-modal/index.tsx
+++ b/packages/app/src/components/logout-modal/index.tsx
@@ -51,26 +51,49 @@ export const LogoutModal = ({ open, onClose }: LoginModalProps) => {
)}
{t('Retain local cached data')}
</StyleTips>
- <div>
- <Button
- style={{ marginRight: '16px' }}
- shape="round"
- onClick={() => {
- onClose(true);
- }}
- >
- {t('Wait for Sync')}
- </Button>
- <Button
- type="danger"
- shape="round"
- onClick={() => {
- onClose(false);
- }}
- >
- {t('Force Sign Out')}
- </Button>
- </div>
+ {blobDataSynced ? (
+ <div>
+ <Button
+ type="danger"
+ shape="round"
+ style={{ marginRight: '16px' }}
+ onClick={async () => {
+ onClose(false);
+ }}
+ >
+ {t('Force Sign Out')}
+ </Button>
+ <Button
+ shape="round"
+ onClick={() => {
+ onClose(true);
+ }}
+ >
+ {t('Wait for Sync')}
+ </Button>
+ </div>
+ ) : (
+ <div>
+ <Button
+ type="primary"
+ style={{ marginRight: '16px' }}
+ shape="round"
+ onClick={() => {
+ onClose(true);
+ }}
+ >
+ {t('Cancel')}
+ </Button>
+ <Button
+ shape="round"
+ onClick={() => {
+ onClose(false);
+ }}
+ >
+ {t('Sign out')}
+ </Button>
+ </div>
+ )}
</Content>
</ModalWrapper>
</Modal>
diff --git a/packages/app/src/components/workspace-modal/index.tsx b/packages/app/src/components/workspace-modal/index.tsx
index 1363763c36..4dd552eaca 100644
--- a/packages/app/src/components/workspace-modal/index.tsx
+++ b/packages/app/src/components/workspace-modal/index.tsx
@@ -132,7 +132,7 @@ export const WorkspaceModal = ({ open, onClose }: WorkspaceModalProps) => {
onClose={async wait => {
if (!wait) {
await logout();
- router.replace(`/workspace`);
+ router.push(`/workspace`);
}
setLogoutOpen(false);
}}