Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Fix channelData replace in conversations #1979

Merged
merged 3 commits into from
Aug 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/botkit/src/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,13 @@ export class BotkitConversation<O extends object = {}> extends Dialog<O> {
}

// copy all the values in channelData fields
for (const key in line.channelData) {
outgoing.channelData = this.parseTemplatesRecursive(JSON.parse(JSON.stringify(line.channelData)), vars)
if (line.channelData && Object.keys(line.channelData).length > 0) {
const channelDataParsed = this.parseTemplatesRecursive(JSON.parse(JSON.stringify(line.channelData)), vars);

outgoing.channelData = {
...outgoing.channelData,
...channelDataParsed
};
}

/*******************************************************************************************************************/
Expand Down