Skip to content

Commit

Permalink
Fix typo in reaction button sample (#3820)
Browse files Browse the repository at this point in the history
* Fix typo

* Update entry

* Comment on console warning

Co-authored-by: Corina <[email protected]>
  • Loading branch information
compulim and corinagum authored Mar 31, 2021
1 parent a13bfd8 commit 9a83743
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [`[email protected]`](https://npmjs.com/package/web-speech-cognitive-services)
- [`[email protected]`](https://npmjs.com/package/whatwg-fetch)

### Samples

- Fixes [#3632](https://github.com/microsoft/BotFramework-WebChat/issues/3632). Fixed typo in reaction button sample, by [@compulim](https://github.com/compulim) in PR [#3820](https://github.com/microsoft/BotFramework-WebChat/pull/3820)

## [4.12.1] - 2021-03-16

### Added
Expand All @@ -89,7 +93,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Samples

- Fixes [#3632](https://github.com/microsoft/BotFramework-WebChat/issues/3632). Update reaction button sample : Add replyToId to the postActivity object, by [@amal-khalaf](https://github.com/amal-khalaf) in PR [#3769](https://github.com/microsoft/BotFramework-WebChat/pull/3769)
- Fixes [#3632](https://github.com/microsoft/BotFramework-WebChat/issues/3632). Update reaction button sample: Add `replyToId` to the `postActivity` object, by [@amal-khalaf](https://github.com/amal-khalaf) in PR [#3769](https://github.com/microsoft/BotFramework-WebChat/pull/3769)

## [4.12.0] - 2021-03-01

Expand Down
10 changes: 7 additions & 3 deletions samples/05.custom-components/d.reaction-buttons/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@
});
};

const handleDownVoteButton = useCallback(() => {
const handleDownvoteButton = useCallback(() => {
addMessageReaction(-1);
}, [activityID, postActivity]);

const handleUpVoteButton = useCallback(() => {
const handleUpvoteButton = useCallback(() => {
addMessageReaction(1);
}, [activityID, postActivity]);

Expand Down Expand Up @@ -116,7 +116,11 @@
const activityMiddleware = () => next => (...setupArgs) => {
const [card] = setupArgs;

if (card.activity.from.role === 'bot') {
if (card.activity.type === 'messageReaction') {
// Currently, Web Chat does not handle "messageReaction" activity and will show a warning in console log as it is an unknown activity.
// In this sample, we will disable the rendering of "messageReaction" activity, so the warning is not shown.
return false;
} else if (card.activity.from.role === 'bot') {
return (...renderArgs) => (
<BotActivityDecorator key={card.activity.id} activityID={card.activity.id}>
{next(...setupArgs)(...renderArgs)}
Expand Down

0 comments on commit 9a83743

Please sign in to comment.