fix(core): auth events are not continuous (#8874)

This commit is contained in:
liuyi
2024-11-20 16:25:37 +08:00
committed by GitHub
parent cc0462e7fe
commit 8b066a4b39
5 changed files with 14 additions and 8 deletions
@@ -2,6 +2,7 @@ import { Skeleton } from '@affine/component';
import { Button } from '@affine/component/ui/button';
import { UrlService } from '@affine/core/modules/url';
import { OAuthProviderType } from '@affine/graphql';
import track from '@affine/track';
import { GithubIcon, GoogleDuotoneIcon } from '@blocksuite/icons/rc';
import { useLiveData, useService } from '@toeverything/infra';
import { type ReactElement, useCallback } from 'react';
@@ -86,6 +87,8 @@ function OAuthProvider({
const oauthUrl =
BUILD_CONFIG.serverUrlPrefix + `/oauth/login?${params.toString()}`;
track.$.$.auth.signIn({ method: 'oauth', provider });
popupWindow(oauthUrl);
}, [popupWindow, provider, redirectUrl, scheme]);
@@ -255,9 +255,7 @@ export function setupTracker() {
});
AIProvider.slots.requestLogin.on(() => {
track.$.$.auth.signIn({
control: 'aiAction',
});
track.doc.editor.aiActions.requestSignIn();
});
AIProvider.slots.actions.on(event => {
@@ -27,7 +27,7 @@ export const SignInItem = () => {
const t = useI18n();
const onClickSignIn = useCallback(() => {
track.$.navigationPanel.workspaceList.signIn();
track.$.navigationPanel.workspaceList.requestSignIn();
setOpen(state => ({
...state,
openModal: true,