mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-12 23:56:36 +08:00
fix(core): show toast for requestRunInEdgeless (#6715)
This commit is contained in:
@@ -14,7 +14,7 @@ export interface Notification {
|
||||
foreground?: string;
|
||||
alignMessage?: 'title' | 'icon';
|
||||
action?: {
|
||||
label: string;
|
||||
label: ReactNode;
|
||||
onClick: (() => void) | (() => Promise<void>);
|
||||
buttonProps?: ButtonProps;
|
||||
/**
|
||||
|
||||
+10
@@ -1,6 +1,8 @@
|
||||
import { notify } from '@affine/component';
|
||||
import { authAtom, openSettingModalAtom } from '@affine/core/atoms';
|
||||
import { mixpanel } from '@affine/core/utils';
|
||||
import { getBaseUrl } from '@affine/graphql';
|
||||
import { Trans } from '@affine/i18n';
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import { AIProvider } from '@blocksuite/presets';
|
||||
import { getCurrentStore } from '@toeverything/infra';
|
||||
@@ -388,4 +390,12 @@ export function setupAIProvider() {
|
||||
openModal: true,
|
||||
}));
|
||||
});
|
||||
|
||||
AIProvider.slots.requestRunInEdgeless.on(() => {
|
||||
notify.warning({
|
||||
title: (
|
||||
<Trans i18nKey="com.affine.ai.action.edgeless-only.dialog-title" />
|
||||
),
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1311,5 +1311,6 @@
|
||||
"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-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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user