fix(core): chat block opens and throws an error (#12407)

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Bug Fixes**
  - Improved stability of the AI chat input to prevent errors when certain configuration options are missing.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
akumatus
2025-05-21 07:05:07 +00:00
parent 8038ab97e6
commit 029a98c435

View File

@@ -274,7 +274,7 @@ export class AIChatInput extends SignalWatcher(WithDisposable(LitElement)) {
accessor reasoningConfig!: AIReasoningConfig;
@property({ attribute: false })
accessor modelSwitchConfig!: AIModelSwitchConfig;
accessor modelSwitchConfig: AIModelSwitchConfig | undefined = undefined;
@property({ attribute: false })
accessor docDisplayConfig!: DocDisplayConfig;
@@ -394,7 +394,7 @@ export class AIChatInput extends SignalWatcher(WithDisposable(LitElement)) {
${ImageIcon()}
<affine-tooltip>Upload</affine-tooltip>
</div>
${this.modelSwitchConfig.visible.value
${this.modelSwitchConfig?.visible.value
? html`
<ai-chat-models
class="chat-input-icon"