mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-20 15:57:06 +08:00
fix: click continue with ai not work (#7374)
This commit is contained in:
@@ -119,6 +119,9 @@ export class ChatCards extends WithDisposable(LitElement) {
|
|||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
accessor temporaryParams: AIChatParams | null = null;
|
accessor temporaryParams: AIChatParams | null = null;
|
||||||
|
|
||||||
|
@property({ attribute: false })
|
||||||
|
accessor isEmpty!: boolean;
|
||||||
|
|
||||||
@state()
|
@state()
|
||||||
accessor cards: Card[] = [];
|
accessor cards: Card[] = [];
|
||||||
|
|
||||||
@@ -508,6 +511,8 @@ export class ChatCards extends WithDisposable(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override render() {
|
protected override render() {
|
||||||
|
if (!this.isEmpty) return nothing;
|
||||||
|
|
||||||
return repeat(
|
return repeat(
|
||||||
this.cards,
|
this.cards,
|
||||||
card => card.id,
|
card => card.id,
|
||||||
|
|||||||
@@ -265,23 +265,18 @@ export class ChatPanelMessages extends WithDisposable(ShadowlessElement) {
|
|||||||
>
|
>
|
||||||
${items.length === 0
|
${items.length === 0
|
||||||
? html`<div class="chat-panel-messages-placeholder">
|
? html`<div class="chat-panel-messages-placeholder">
|
||||||
${AffineIcon(
|
${AffineIcon(
|
||||||
isLoading
|
isLoading
|
||||||
? 'var(--affine-icon-secondary)'
|
? 'var(--affine-icon-secondary)'
|
||||||
: 'var(--affine-primary-color)'
|
: 'var(--affine-primary-color)'
|
||||||
)}
|
)}
|
||||||
<div>
|
<div>
|
||||||
${this.isLoading
|
${this.isLoading
|
||||||
? 'AFFiNE AI is loading history...'
|
? 'AFFiNE AI is loading history...'
|
||||||
: 'What can I help you with?'}
|
: 'What can I help you with?'}
|
||||||
</div>
|
|
||||||
${this._renderAIOnboarding()}
|
|
||||||
</div>
|
</div>
|
||||||
<chat-cards
|
${this._renderAIOnboarding()}
|
||||||
.updateContext=${this.updateContext}
|
</div> `
|
||||||
.host=${this.host}
|
|
||||||
?data-show=${this.showChatCards}
|
|
||||||
></chat-cards>`
|
|
||||||
: repeat(filteredItems, (item, index) => {
|
: repeat(filteredItems, (item, index) => {
|
||||||
const isLast = index === filteredItems.length - 1;
|
const isLast = index === filteredItems.length - 1;
|
||||||
return html`<div class="message">
|
return html`<div class="message">
|
||||||
@@ -289,6 +284,12 @@ export class ChatPanelMessages extends WithDisposable(ShadowlessElement) {
|
|||||||
<div class="item-wrapper">${this.renderItem(item, isLast)}</div>
|
<div class="item-wrapper">${this.renderItem(item, isLast)}</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
})}
|
})}
|
||||||
|
<chat-cards
|
||||||
|
.updateContext=${this.updateContext}
|
||||||
|
.host=${this.host}
|
||||||
|
.isEmpty=${items.length === 0}
|
||||||
|
?data-show=${this.showChatCards}
|
||||||
|
></chat-cards>
|
||||||
</div>
|
</div>
|
||||||
${this.showDownIndicator
|
${this.showDownIndicator
|
||||||
? html`<div class="down-indicator" @click=${() => this.scrollToDown()}>
|
? html`<div class="down-indicator" @click=${() => this.scrollToDown()}>
|
||||||
|
|||||||
Reference in New Issue
Block a user