summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-07-12 16:06:03 -0400
committerGitHub <noreply@github.com>2016-07-12 16:06:03 -0400
commitcaef414abea77bf0576aef927c9eaf0f205f9b6f (patch)
treef3e7597ab7c791186e5384bbf7e7b13aa973a832 /webapp
parent34ec30e80605e5285cd398be55318cc27d83939a (diff)
downloadchat-caef414abea77bf0576aef927c9eaf0f205f9b6f.tar.gz
chat-caef414abea77bf0576aef927c9eaf0f205f9b6f.tar.bz2
chat-caef414abea77bf0576aef927c9eaf0f205f9b6f.zip
PLT-3631 Properly update PostViewController when emojis change (#3565)
* Properly remove custom emojis from clientside store * Properly update PostViewController when emojis change
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/post_view/post_view_controller.jsx4
-rw-r--r--webapp/stores/emoji_store.jsx12
2 files changed, 14 insertions, 2 deletions
diff --git a/webapp/components/post_view/post_view_controller.jsx b/webapp/components/post_view/post_view_controller.jsx
index 17c3e94ae..e5743e657 100644
--- a/webapp/components/post_view/post_view_controller.jsx
+++ b/webapp/components/post_view/post_view_controller.jsx
@@ -247,6 +247,10 @@ export default class PostViewController extends React.Component {
return true;
}
+ if (nextState.emojis !== this.state.emojis) {
+ return true;
+ }
+
return false;
}
diff --git a/webapp/stores/emoji_store.jsx b/webapp/stores/emoji_store.jsx
index 5e1d81dd3..e369885b4 100644
--- a/webapp/stores/emoji_store.jsx
+++ b/webapp/stores/emoji_store.jsx
@@ -54,12 +54,13 @@ class EmojiStore extends EventEmitter {
this.addCustomEmoji(emoji);
}
- // add custom emojis to the map first so that they can't override system ones
- this.emojis = new Map([...this.customEmojis, ...this.systemEmojis]);
+ this.updateEmojiMap();
}
addCustomEmoji(emoji) {
this.customEmojis.set(emoji.name, emoji);
+
+ // this doesn't update this.emojis, but it's only called by setCustomEmojis which does that afterwards
}
removeCustomEmoji(id) {
@@ -69,6 +70,13 @@ class EmojiStore extends EventEmitter {
break;
}
}
+
+ this.updateEmojiMap();
+ }
+
+ updateEmojiMap() {
+ // add custom emojis to the map first so that they can't override system ones
+ this.emojis = new Map([...this.customEmojis, ...this.systemEmojis]);
}
getSystemEmojis() {