Handle all variants of hearts as the same

This commit is contained in:
Eduard Kuzmenko 2022-01-25 19:25:48 +04:00
parent 10b7307141
commit 321aab5e44
1 changed files with 7 additions and 1 deletions

View File

@ -50,7 +50,7 @@ export class AppStickersManager {
private getGreetingStickersPromise: Promise<void>;
private sounds: Record<string, MyDocument>;
getAnimatedEmojiSoundsPromise: Promise<void>;
private getAnimatedEmojiSoundsPromise: Promise<void>;
constructor() {
this.getStickerSetPromises = {};
@ -231,6 +231,12 @@ export class AppStickersManager {
const stickerSet = this.storage.getFromCache(isAnimation ? EMOJI_ANIMATIONS_SET_LOCAL_ID : EMOJI_SET_LOCAL_ID);
if(!stickerSet || !stickerSet.documents) return undefined;
if(isAnimation) {
if(['🧡', '💛', '💚', '💙', '💜', '🖤', '🤍', '🤎'].includes(emoji)) {
emoji = '❤️';
}
}
emoji = this.cleanEmoji(emoji);
const pack = stickerSet.packs.find(p => p.emoticon === emoji);
return pack ? appDocsManager.getDoc(pack.documents[0]) : undefined;