fix: logout will jump to 404 error

This commit is contained in:
DiamondThree
2023-02-07 19:18:28 +08:00
parent a0f5d089d1
commit 028fdae8b1
2 changed files with 44 additions and 21 deletions

View File

@@ -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>

View File

@@ -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);
}}