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')} {t('Retain local cached data')}
</StyleTips> </StyleTips>
<div> {blobDataSynced ? (
<Button <div>
style={{ marginRight: '16px' }} <Button
shape="round" type="danger"
onClick={() => { shape="round"
onClose(true); style={{ marginRight: '16px' }}
}} onClick={async () => {
> onClose(false);
{t('Wait for Sync')} }}
</Button> >
<Button {t('Force Sign Out')}
type="danger" </Button>
shape="round" <Button
onClick={() => { shape="round"
onClose(false); onClick={() => {
}} onClose(true);
> }}
{t('Force Sign Out')} >
</Button> {t('Wait for Sync')}
</div> </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> </Content>
</ModalWrapper> </ModalWrapper>
</Modal> </Modal>

View File

@@ -132,7 +132,7 @@ export const WorkspaceModal = ({ open, onClose }: WorkspaceModalProps) => {
onClose={async wait => { onClose={async wait => {
if (!wait) { if (!wait) {
await logout(); await logout();
router.replace(`/workspace`); router.push(`/workspace`);
} }
setLogoutOpen(false); setLogoutOpen(false);
}} }}