Fix Clear All status icons action

The problem was caused by a wrong parameter being passed down
to the function that set the emoji status for the user

close #7924
This commit is contained in:
Joao Siebel 2019-08-19 09:56:21 -03:00
parent 35399bde6d
commit 132609414a
4 changed files with 7 additions and 9 deletions

View File

@ -27,9 +27,7 @@ export default function handleEmojiStatus({ body }, meetingId) {
} }
if (numChanged) { if (numChanged) {
Logger.info(`Assigned user emoji status${ Logger.info(`Assigned user emoji status ${emoji} id=${userId} meeting=${meetingId}`);
emoji} id=${userId} meeting=${meetingId}`,
);
} }
}; };

View File

@ -368,12 +368,12 @@ const normalizeEmojiName = emoji => (
emoji in EMOJI_STATUSES ? EMOJI_STATUSES[emoji] : emoji emoji in EMOJI_STATUSES ? EMOJI_STATUSES[emoji] : emoji
); );
const setEmojiStatus = (data) => { const setEmojiStatus = (userId, emoji) => {
const statusAvailable = (Object.keys(EMOJI_STATUSES).includes(data)); const statusAvailable = (Object.keys(EMOJI_STATUSES).includes(emoji));
return statusAvailable return statusAvailable
? makeCall('setEmojiStatus', Auth.userID, data) ? makeCall('setEmojiStatus', Auth.userID, emoji)
: makeCall('setEmojiStatus', data, 'none'); : makeCall('setEmojiStatus', userId, 'none');
}; };
const assignPresenter = (userId) => { makeCall('assignPresenter', userId); }; const assignPresenter = (userId) => { makeCall('assignPresenter', userId); };

View File

@ -272,7 +272,7 @@ class UserDropdown extends PureComponent {
statuses.map(status => actions.push(this.makeDropdownItem( statuses.map(status => actions.push(this.makeDropdownItem(
status, status,
intl.formatMessage({ id: `app.actionsBar.emojiMenu.${status}Label` }), intl.formatMessage({ id: `app.actionsBar.emojiMenu.${status}Label` }),
() => { handleEmojiChange(status); this.resetMenuState(); }, () => { handleEmojiChange(user.id, status); this.resetMenuState(); },
getEmojiList[status], getEmojiList[status],
))); )));

View File

@ -37,7 +37,7 @@ const UserOptionsContainer = withTracker((props) => {
} = props; } = props;
const toggleStatus = () => { const toggleStatus = () => {
users.forEach(id => setEmojiStatus(id, 'none')); users.forEach(user => setEmojiStatus(user.userId, 'none'));
notify( notify(
intl.formatMessage(intlMessages.clearStatusMessage), 'info', 'clear_status', intl.formatMessage(intlMessages.clearStatusMessage), 'info', 'clear_status',
); );