Browse Source

Handle all variants of hearts as the same

master
Eduard Kuzmenko 3 years ago
parent
commit
edf5553692
  1. 8
      src/lib/appManagers/appStickersManager.ts

8
src/lib/appManagers/appStickersManager.ts

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

Loading…
Cancel
Save