mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-22 21:51:39 +03:00
fix: login and upload affine workspace in one run (#1662)
This commit is contained in:
parent
8ed40bfae9
commit
35d4560e9f
@ -110,10 +110,10 @@ const SettingPage: NextPageWithLayout = () => {
|
||||
to: To,
|
||||
workspace: FlavourToWorkspace[From]
|
||||
): Promise<void> => {
|
||||
if (to === RemWorkspaceFlavour.AFFINE && !apis.auth.isLogin) {
|
||||
const needRefresh =
|
||||
to === RemWorkspaceFlavour.AFFINE && !apis.auth.isLogin;
|
||||
if (needRefresh) {
|
||||
await apis.signInWithGoogle();
|
||||
router.reload();
|
||||
return;
|
||||
}
|
||||
const workspaceId = await transformWorkspace(from, to, workspace);
|
||||
await router.replace({
|
||||
@ -123,6 +123,9 @@ const SettingPage: NextPageWithLayout = () => {
|
||||
workspaceId,
|
||||
},
|
||||
});
|
||||
if (needRefresh) {
|
||||
router.reload();
|
||||
}
|
||||
},
|
||||
[router, transformWorkspace]
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user