PLT-6249: Erase custom emoji in "recently used" after deleted (#6242)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
ad701900ef
Коммит
fb3cc12f56
@@ -139,6 +139,17 @@ class EmojiStore extends EventEmitter {
|
|||||||
return this.map.get(name);
|
return this.map.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
removeRecentEmoji(id) {
|
||||||
|
const recentEmojis = this.getRecentEmojis();
|
||||||
|
for (let i = recentEmojis.length - 1; i >= 0; i--) {
|
||||||
|
if (recentEmojis[i].id === id) {
|
||||||
|
recentEmojis.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
localStorage.setItem(Constants.RECENT_EMOJI_KEY, JSON.stringify(recentEmojis));
|
||||||
|
}
|
||||||
|
|
||||||
addRecentEmoji(rawAlias) {
|
addRecentEmoji(rawAlias) {
|
||||||
const recentEmojis = this.getRecentEmojis();
|
const recentEmojis = this.getRecentEmojis();
|
||||||
|
|
||||||
@@ -214,6 +225,7 @@ class EmojiStore extends EventEmitter {
|
|||||||
break;
|
break;
|
||||||
case ActionTypes.REMOVED_CUSTOM_EMOJI:
|
case ActionTypes.REMOVED_CUSTOM_EMOJI:
|
||||||
this.removeCustomEmoji(action.id);
|
this.removeCustomEmoji(action.id);
|
||||||
|
this.removeRecentEmoji(action.id);
|
||||||
this.emitChange();
|
this.emitChange();
|
||||||
break;
|
break;
|
||||||
case ActionTypes.EMOJI_POSTED:
|
case ActionTypes.EMOJI_POSTED:
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user