From 397887e3b504619a40efea0c472aad1feeda45ab Mon Sep 17 00:00:00 2001 From: akumatus Date: Mon, 10 Feb 2025 10:40:14 +0000 Subject: [PATCH] fix(core): not using Internet search after user selects document or file (#10058) Fix issue [BS-2546](https://linear.app/affine-design/issue/BS-2546). --- .../presets/ai/chat-panel/chat-panel-input.ts | 5 ++++- .../block-suite-editor/ai/setup-provider.tsx | 18 +++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts b/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts index 3b1fc613cd..62a98b2f1d 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts @@ -363,7 +363,10 @@ export class ChatPanelInput extends SignalWatcher(WithDisposable(LitElement)) { const { images, status } = this.chatContextValue; const hasImages = images.length > 0; const maxHeight = hasImages ? 272 + 2 : 200 + 2; - const networkDisabled = !!this.chatContextValue.images.length; + const networkDisabled = + !!this.chatContextValue.images.length || + !!this.chatContextValue.chips.filter(chip => chip.state !== 'candidate') + .length; const networkActive = !!this.networkSearchConfig.enabled.value; const uploadDisabled = networkActive && !networkDisabled; return html`