fix(core): fix ai with multiple server (#11570)

This commit is contained in:
EYHN
2025-04-17 13:31:53 +00:00
parent 5e9ad634b7
commit a9e4690d2d
3 changed files with 30 additions and 21 deletions
@@ -12,6 +12,7 @@ import { useRegisterFindInPageCommands } from '@affine/core/components/hooks/aff
import { useRegisterWorkspaceCommands } from '@affine/core/components/hooks/use-register-workspace-commands';
import { OverCapacityNotification } from '@affine/core/components/over-capacity';
import {
AuthService,
EventSourceService,
FetchService,
GraphQLService,
@@ -148,6 +149,7 @@ export const WorkspaceSideEffects = () => {
const graphqlService = useService(GraphQLService);
const eventSourceService = useService(EventSourceService);
const fetchService = useService(FetchService);
const authService = useService(AuthService);
useEffect(() => {
const dispose = setupAIProvider(
@@ -156,7 +158,8 @@ export const WorkspaceSideEffects = () => {
fetchService.fetch,
eventSourceService.eventSource
),
globalDialogService
globalDialogService,
authService
);
return () => {
dispose();
@@ -167,6 +170,7 @@ export const WorkspaceSideEffects = () => {
workspaceDialogService,
graphqlService,
globalDialogService,
authService,
]);
useRegisterWorkspaceCommands();