feat(editor): Retrieve previous chat message on arrow-up (#8696)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2024-02-22 09:32:34 +01:00
committed by GitHub
parent a5e6f5928a
commit 246f8cfcc3
5 changed files with 38 additions and 5 deletions

View File

@@ -125,6 +125,7 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
executionWaitingForWebhook: false,
nodeMetadata: {},
isInDebugMode: false,
chatMessages: [],
}),
getters: {
// Workflow getters
@@ -277,6 +278,9 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
getTotalFinishedExecutionsCount(): number {
return this.finishedExecutionsCount;
},
getPastChatMessages(): string[] {
return Array.from(new Set(this.chatMessages));
},
},
actions: {
getPinDataSize(pinData: Record<string, string | INodeExecutionData[]> = {}): number {
@@ -1436,5 +1440,13 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
},
};
},
resetChatMessages(): void {
this.chatMessages = [];
},
appendChatMessage(message: string): void {
this.chatMessages.push(message);
},
},
});