fix: login and upload affine workspace in one run (#1662)
This commit is contained in:
@@ -110,10 +110,10 @@ const SettingPage: NextPageWithLayout = () => {
|
|||||||
to: To,
|
to: To,
|
||||||
workspace: FlavourToWorkspace[From]
|
workspace: FlavourToWorkspace[From]
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
if (to === RemWorkspaceFlavour.AFFINE && !apis.auth.isLogin) {
|
const needRefresh =
|
||||||
|
to === RemWorkspaceFlavour.AFFINE && !apis.auth.isLogin;
|
||||||
|
if (needRefresh) {
|
||||||
await apis.signInWithGoogle();
|
await apis.signInWithGoogle();
|
||||||
router.reload();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
const workspaceId = await transformWorkspace(from, to, workspace);
|
const workspaceId = await transformWorkspace(from, to, workspace);
|
||||||
await router.replace({
|
await router.replace({
|
||||||
@@ -123,6 +123,9 @@ const SettingPage: NextPageWithLayout = () => {
|
|||||||
workspaceId,
|
workspaceId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
if (needRefresh) {
|
||||||
|
router.reload();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
[router, transformWorkspace]
|
[router, transformWorkspace]
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user