summaryrefslogtreecommitdiffstats
path: root/webapp/stores/emoji_store.jsx
diff options
context:
space:
mode:
authorRyan Wang <R-Wang97@users.noreply.github.com>2017-04-03 21:27:14 -0400
committerJoram Wilander <jwawilander@gmail.com>2017-04-03 21:27:14 -0400
commit169c490892041a7551b167e5f7ab4859ab003bae (patch)
tree821a7631d59681a87d7f8b47bc1c622018b85326 /webapp/stores/emoji_store.jsx
parent1bcb5cdb9d6de7690edf271da5eedc6fb74789d9 (diff)
downloadchat-169c490892041a7551b167e5f7ab4859ab003bae.tar.gz
chat-169c490892041a7551b167e5f7ab4859ab003bae.tar.bz2
chat-169c490892041a7551b167e5f7ab4859ab003bae.zip
Save recently used emojis after logout (#5926)
Diffstat (limited to 'webapp/stores/emoji_store.jsx')
-rw-r--r--webapp/stores/emoji_store.jsx5
1 files changed, 2 insertions, 3 deletions
diff --git a/webapp/stores/emoji_store.jsx b/webapp/stores/emoji_store.jsx
index 444a27c72..432c176d2 100644
--- a/webapp/stores/emoji_store.jsx
+++ b/webapp/stores/emoji_store.jsx
@@ -10,7 +10,6 @@ import * as Emoji from 'utils/emoji.jsx';
const ActionTypes = Constants.ActionTypes;
const CHANGE_EVENT = 'changed';
-const RECENT_EMOJI_KEY = 'recentEmojis';
const MAXIMUM_RECENT_EMOJI = 27;
// Wrap the contents of the store so that we don't need to construct an ES6 map where most of the content
@@ -171,11 +170,11 @@ class EmojiStore extends EventEmitter {
if (recentEmojis.length > MAXIMUM_RECENT_EMOJI) {
recentEmojis.splice(0, recentEmojis.length - MAXIMUM_RECENT_EMOJI);
}
- localStorage.setItem(RECENT_EMOJI_KEY, JSON.stringify(recentEmojis));
+ localStorage.setItem(Constants.RECENT_EMOJI_KEY, JSON.stringify(recentEmojis));
}
getRecentEmojis() {
- const result = JSON.parse(localStorage.getItem(RECENT_EMOJI_KEY));
+ const result = JSON.parse(localStorage.getItem(Constants.RECENT_EMOJI_KEY));
if (!result) {
return [];
}