fix: check if login when enable affine cloud (#1445)

This commit is contained in:
Himself65
2023-03-09 01:26:07 -06:00
committed by GitHub
parent b23547f4bd
commit 6b533c44be
4 changed files with 41 additions and 24 deletions

View File

@@ -16,6 +16,7 @@ import {
LocalWorkspace,
RemWorkspaceFlavour,
} from '../../../../shared';
import { apis } from '../../../../shared/apis';
import { TransformWorkspaceToAffineModal } from '../../../affine/transform-workspace-to-affine-modal';
const IconWrapper = styled('div')(({ theme }) => {
@@ -112,6 +113,11 @@ export const SyncUser = () => {
setOpen(false);
}}
onConform={async () => {
if (!apis.auth.isLogin) {
await apis.signInWithGoogle();
router.reload();
return;
}
assertEquals(workspace.flavour, RemWorkspaceFlavour.LOCAL);
const id = await transformWorkspace(
RemWorkspaceFlavour.LOCAL,