mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
feat: move data center to root
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { signInWithGoogle } from '@affine/datacenter';
|
||||
import { getDataCenter } from '@affine/datacenter';
|
||||
import { styled } from '@/styles';
|
||||
import { Button } from '@/ui/button';
|
||||
import { useModal } from '@/providers/global-modal-provider';
|
||||
@@ -9,7 +9,8 @@ export const GoogleLoginButton = () => {
|
||||
return (
|
||||
<StyledGoogleButton
|
||||
onClick={() => {
|
||||
signInWithGoogle()
|
||||
getDataCenter()
|
||||
.then(dc => dc.apis.signInWithGoogle())
|
||||
.then(() => {
|
||||
triggerLoginModal();
|
||||
})
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
import { createContext, MutableRefObject, useContext } from 'react';
|
||||
import type { Workspace } from '@affine/datacenter';
|
||||
import { AccessTokenMessage } from '@affine/datacenter';
|
||||
import type {
|
||||
Page as StorePage,
|
||||
Workspace as StoreWorkspace,
|
||||
} from '@blocksuite/store';
|
||||
import type { EditorContainer } from '@blocksuite/editor';
|
||||
export type LoadWorkspaceHandler = (
|
||||
workspaceId: string,
|
||||
user?: AccessTokenMessage | null
|
||||
workspaceId: string
|
||||
// user?: AccessTokenMessage | null
|
||||
) => Promise<StoreWorkspace | null> | null;
|
||||
export type CreateEditorHandler = (page: StorePage) => EditorContainer | null;
|
||||
|
||||
export interface AppStateValue {
|
||||
user: AccessTokenMessage | null;
|
||||
// user: AccessTokenMessage | null;
|
||||
workspacesMeta: Workspace[];
|
||||
|
||||
currentWorkspaceId: string;
|
||||
@@ -39,7 +38,7 @@ export interface AppStateContext extends AppStateValue {
|
||||
}
|
||||
|
||||
export const AppState = createContext<AppStateContext>({
|
||||
user: null,
|
||||
// user: null,
|
||||
workspacesMeta: [],
|
||||
|
||||
currentWorkspaceId: '',
|
||||
|
||||
Reference in New Issue
Block a user