summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-06-21 10:38:19 -0400
committerGitHub <noreply@github.com>2017-06-21 10:38:19 -0400
commit6bfb7ea3a91187a3f95f22b16933530eb784e06f (patch)
tree40af3e54ffb160c886c0f10db31ce13e135ab015 /webapp
parentf80003a975d40741803fee576f57f2700a95656f (diff)
downloadchat-6bfb7ea3a91187a3f95f22b16933530eb784e06f.tar.gz
chat-6bfb7ea3a91187a3f95f22b16933530eb784e06f.tar.bz2
chat-6bfb7ea3a91187a3f95f22b16933530eb784e06f.zip
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
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/reaction/reaction.jsx12
-rw-r--r--webapp/components/suggestion/emoticon_provider.jsx9
-rw-r--r--webapp/yarn.lock2
3 files changed, 19 insertions, 4 deletions
diff --git a/webapp/components/post_view/reaction/reaction.jsx b/webapp/components/post_view/reaction/reaction.jsx
index 5b65e604f..7fad56d62 100644
--- a/webapp/components/post_view/reaction/reaction.jsx
+++ b/webapp/components/post_view/reaction/reaction.jsx
@@ -42,6 +42,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
*/
emojiImageUrl: PropTypes.string.isRequired,
@@ -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}
diff --git a/webapp/components/suggestion/emoticon_provider.jsx b/webapp/components/suggestion/emoticon_provider.jsx
index 0a7f1ff8a..1de35dc20 100644
--- a/webapp/components/suggestion/emoticon_provider.jsx
+++ b/webapp/components/suggestion/emoticon_provider.jsx
@@ -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) {
diff --git a/webapp/yarn.lock b/webapp/yarn.lock
index 044fa1852..a8ad3f41d 100644
--- a/webapp/yarn.lock
+++ b/webapp/yarn.lock
@@ -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"