mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Fix JS error when hovering over reactions (#6710)
* Fix JS error when hovering over reactions * Fix autocomplete for custom emojis * Update to latest mattermost-redux
This commit is contained in:
@@ -41,6 +41,11 @@ export default class Reaction extends React.PureComponent {
|
||||
*/
|
||||
otherUsersCount: PropTypes.number.isRequired,
|
||||
|
||||
/*
|
||||
* Array of reactions by user
|
||||
*/
|
||||
reactions: PropTypes.arrayOf(PropTypes.object).isRequired,
|
||||
|
||||
/*
|
||||
* The URL of the emoji image
|
||||
*/
|
||||
@@ -82,6 +87,11 @@ export default class Reaction extends React.PureComponent {
|
||||
this.props.actions.removeReaction(this.props.post.id, this.props.emojiName);
|
||||
}
|
||||
|
||||
loadMissingProfiles = () => {
|
||||
const ids = this.props.reactions.map((reaction) => reaction.user_id);
|
||||
this.props.actions.getMissingProfilesByIds(ids);
|
||||
}
|
||||
|
||||
render() {
|
||||
let currentUserReacted = false;
|
||||
const users = [];
|
||||
@@ -219,7 +229,7 @@ export default class Reaction extends React.PureComponent {
|
||||
{clickTooltip}
|
||||
</Tooltip>
|
||||
}
|
||||
onEnter={this.props.actions.getMissingProfilesByIds}
|
||||
onEnter={this.loadMissingProfiles}
|
||||
>
|
||||
<div
|
||||
className={className}
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import EmojiStore from 'stores/emoji_store.jsx';
|
||||
import {default as EmojiStore, EmojiMap} from 'stores/emoji_store.jsx';
|
||||
import * as Emoticons from 'utils/emoticons.jsx';
|
||||
import SuggestionStore from 'stores/suggestion_store.jsx';
|
||||
|
||||
import Suggestion from './suggestion.jsx';
|
||||
|
||||
import store from 'stores/redux_store.jsx';
|
||||
import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis';
|
||||
|
||||
const MIN_EMOTICON_LENGTH = 2;
|
||||
|
||||
class EmoticonSuggestion extends Suggestion {
|
||||
@@ -71,8 +74,10 @@ export default class EmoticonProvider {
|
||||
}
|
||||
}
|
||||
|
||||
const emojis = new EmojiMap(getCustomEmojisByName(store.getState()));
|
||||
|
||||
// check for named emoji
|
||||
for (const [name, emoji] of EmojiStore.getEmojis()) {
|
||||
for (const [name, emoji] of emojis) {
|
||||
if (emoji.aliases) {
|
||||
// This is a system emoji so it may have multiple names
|
||||
for (const alias of emoji.aliases) {
|
||||
|
||||
@@ -4884,7 +4884,7 @@ math-expression-evaluator@^1.2.14:
|
||||
|
||||
mattermost-redux@mattermost/mattermost-redux#webapp-master:
|
||||
version "0.0.1"
|
||||
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/f19e3ea5487dcd172d177d271f1b596b23ef6ea5"
|
||||
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/713e134e945a97dd92f4217301231b8a7af20216"
|
||||
dependencies:
|
||||
deep-equal "1.0.1"
|
||||
harmony-reflect "1.5.1"
|
||||
|
||||
Reference in New Issue
Block a user