mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
fix(core): after clearing the history, new chat will report an error (#11549)
Close [BS-3025](https://linear.app/affine-design/issue/BS-3025)
This commit is contained in:
@@ -408,7 +408,6 @@ export class ChatPanel extends SignalWatcher(
|
||||
.doc=${this.doc}
|
||||
.getSessionId=${this._getSessionId}
|
||||
.createSessionId=${this._createSessionId}
|
||||
.createChatSessionId=${this._createSessionId}
|
||||
.chatContextValue=${this.chatContextValue}
|
||||
.updateContext=${this.updateContext}
|
||||
.updateEmbeddingProgress=${this._updateEmbeddingProgress}
|
||||
|
||||
+1
-4
@@ -58,9 +58,6 @@ export class AIChatComposer extends SignalWatcher(
|
||||
@property({ attribute: false })
|
||||
accessor createSessionId!: () => Promise<string | undefined>;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor createChatSessionId!: () => Promise<string | undefined>;
|
||||
|
||||
@property({ attribute: false })
|
||||
accessor chatContextValue!: AIChatInputContext;
|
||||
|
||||
@@ -123,7 +120,7 @@ export class AIChatComposer extends SignalWatcher(
|
||||
.host=${this.host}
|
||||
.chips=${this.chips}
|
||||
.getSessionId=${this.getSessionId}
|
||||
.createSessionId=${this.createChatSessionId}
|
||||
.createSessionId=${this.createSessionId}
|
||||
.getContextId=${this._getContextId}
|
||||
.chatContextValue=${this.chatContextValue}
|
||||
.updateContext=${this.updateContext}
|
||||
|
||||
@@ -141,14 +141,10 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
};
|
||||
|
||||
private readonly _getSessionId = async () => {
|
||||
return this._sessionId;
|
||||
return this._forkSessionId ?? this._sessionId;
|
||||
};
|
||||
|
||||
private readonly _createSessionId = async () => {
|
||||
return this._sessionId;
|
||||
};
|
||||
|
||||
private readonly _createForkSessionId = async () => {
|
||||
if (this._forkSessionId) {
|
||||
return this._forkSessionId;
|
||||
}
|
||||
@@ -506,7 +502,6 @@ export class AIChatBlockPeekView extends LitElement {
|
||||
.doc=${this.host.doc}
|
||||
.getSessionId=${this._getSessionId}
|
||||
.createSessionId=${this._createSessionId}
|
||||
.createChatSessionId=${this._createForkSessionId}
|
||||
.chatContextValue=${chatContext}
|
||||
.updateContext=${updateContext}
|
||||
.onHistoryCleared=${this._onHistoryCleared}
|
||||
|
||||
Reference in New Issue
Block a user