Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: compulim <[email protected]>
  • Loading branch information
Corina and compulim authored Jan 23, 2019
1 parent 52e8c14 commit 7051a54
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions packages/component/src/Composer.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ function patchPropsForAvatarInitials({ botAvatarInitials, userAvatarInitials, ..
if (botAvatarInitials) {
styleOptions = { ...styleOptions, botAvatarInitials };

console.warn('Web Chat: "botAvatarInitials" is deprecated. Please use "styleOptions.botAvatarInitials" instead. This feature will be removed on or after 2019 December 11.');
console.warn('Web Chat: "botAvatarInitials" is deprecated. Please use "styleOptions.botAvatarInitials" instead. "botAvatarInitials" will be removed on or after December 11 2019 .');
}

if (userAvatarInitials) {
styleOptions = { ...styleOptions, userAvatarInitials };

console.warn('Web Chat: "userAvatarInitials" is deprecated. Please use "styleOptions.userAvatarInitials" instead. This feature will be removed on or after 2019 December 11.');
console.warn('Web Chat: "botAvatarInitials" is deprecated. Please use "styleOptions.botAvatarInitials" instead. "botAvatarInitials" will be removed on or after December 11 2019 .');
}

return {
Expand Down Expand Up @@ -242,7 +242,7 @@ class Composer extends React.Component {
if (
!prevProps.sendTypingIndicator !== !sendTypingIndicator

// TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13
// TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020
|| !prevProps.sendTyping !== !sendTyping
) {
this.setSendTypingIndicatorFromProps(props);
Expand Down Expand Up @@ -270,8 +270,8 @@ class Composer extends React.Component {
if (typeof props.sendTyping === 'undefined') {
props.dispatch(setSendTypingIndicator(!!props.sendTypingIndicator));
} else {
// TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13
console.warn('Web Chat: "sendTyping" has been renamed to "sendTypingIndicator". Please use "sendTypingIndicator" instead. This deprecation migration will be removed on or after 2020 January 13.');
// TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020
console.warn('Web Chat: "sendTyping" has been renamed to "sendTypingIndicator". Please use "sendTypingIndicator" instead. This deprecation migration will be removed on or after January 13 2020.');
props.dispatch(setSendTypingIndicator(!!props.sendTyping));
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ export {
submitSendBox,
version,

// TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13
// TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020
setSendTyping
}
2 changes: 1 addition & 1 deletion packages/core/src/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ export default combineReducers({
sendTypingIndicator,
suggestedActions,

// TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13
// TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020
sendTyping: sendTypingIndicator
})
2 changes: 1 addition & 1 deletion packages/core/src/reducers/sendTypingIndicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function (state = DEFAULT_STATE, { payload, type }) {
switch (type) {
// TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13
case SET_SEND_TYPING:
console.warn('Web Chat: "sendTyping" has been renamed to "sendTypingIndicator". Please use "sendTypingIndicator" instead. This deprecation migration will be removed on or after 2020 January 13.');
console.warn('Web Chat: "sendTyping" has been renamed to "sendTypingIndicator". Please use "sendTypingIndicator" instead. This deprecation migration will be removed on or after January 13 2020.');
state = payload.sendTyping;
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function takeSendTypingIndicator(value) {
({ payload, type }) => (
(type === SET_SEND_TYPING_INDICATOR && !payload.sendTypingIndicator === !value)

// TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13
// TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020
|| (type === SET_SEND_TYPING && !payload.sendTyping === !value)
)
);
Expand Down
4 changes: 2 additions & 2 deletions samples/07.b.customization-send-typing-indicator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({ token }),

// Web Chat will send typing activity, on behalf of the user, when "sendTypingIndicator" is set to true.
// The typing indicator will be send when the send box by any means, including speech.
// Web Chat will send a typing activity, on behalf of the user, when "sendTypingIndicator" is set to true.
// The typing indicator will be sent when the send box by any means, including speech.
sendTypingIndicator: true,

// The following code is added for demo purpose only.
Expand Down

0 comments on commit 7051a54

Please sign in to comment.