Не подтверждена Коммит 5c861939 создал по автору pengx17's avatar pengx17
Просмотр файлов

fix(core): show toast for requestRunInEdgeless (#6715)

владелец 7c5a259e
...@@ -14,7 +14,7 @@ export interface Notification { ...@@ -14,7 +14,7 @@ export interface Notification {
foreground?: string; foreground?: string;
alignMessage?: 'title' | 'icon'; alignMessage?: 'title' | 'icon';
action?: { action?: {
label: string; label: ReactNode;
onClick: (() => void) | (() => Promise<void>); onClick: (() => void) | (() => Promise<void>);
buttonProps?: ButtonProps; buttonProps?: ButtonProps;
/** /**
......
import { notify } from '@affine/component';
import { authAtom, openSettingModalAtom } from '@affine/core/atoms'; import { authAtom, openSettingModalAtom } from '@affine/core/atoms';
import { mixpanel } from '@affine/core/utils'; import { mixpanel } from '@affine/core/utils';
import { getBaseUrl } from '@affine/graphql'; import { getBaseUrl } from '@affine/graphql';
import { Trans } from '@affine/i18n';
import { assertExists } from '@blocksuite/global/utils'; import { assertExists } from '@blocksuite/global/utils';
import { AIProvider } from '@blocksuite/presets'; import { AIProvider } from '@blocksuite/presets';
import { getCurrentStore } from '@toeverything/infra'; import { getCurrentStore } from '@toeverything/infra';
...@@ -388,4 +390,12 @@ export function setupAIProvider() { ...@@ -388,4 +390,12 @@ export function setupAIProvider() {
openModal: true, openModal: true,
})); }));
}); });
AIProvider.slots.requestRunInEdgeless.on(() => {
notify.warning({
title: (
<Trans i18nKey="com.affine.ai.action.edgeless-only.dialog-title" />
),
});
});
} }
...@@ -1311,5 +1311,6 @@ ...@@ -1311,5 +1311,6 @@
"com.affine.ai.login-required.dialog-title": "Sign in to Continue", "com.affine.ai.login-required.dialog-title": "Sign in to Continue",
"com.affine.ai.login-required.dialog-content": "To use AFFiNE AI, please sign in to your AFFiNE Cloud account.", "com.affine.ai.login-required.dialog-content": "To use AFFiNE AI, please sign in to your AFFiNE Cloud account.",
"com.affine.ai.login-required.dialog-confirm": "Sign in", "com.affine.ai.login-required.dialog-confirm": "Sign in",
"com.affine.ai.login-required.dialog-cancel": "Cancel" "com.affine.ai.login-required.dialog-cancel": "Cancel",
"com.affine.ai.action.edgeless-only.dialog-title": "Please switch to edgeless mode"
} }
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать