fix emoji pipeline

This commit is contained in:
Nicolas Constant 2020-04-30 02:11:02 -04:00
parent 560147743d
commit 6f96de22ce
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 14 additions and 11 deletions

View File

@ -10,13 +10,16 @@ export class AccountEmojiPipe implements PipeTransform {
private emojiConverter = new EmojiConverter();
transform(value: Account, text?: string): any {
try {
let textToTransform = text;
if(!text){
if(value.display_name) textToTransform = value.display_name;
if (!text) {
if (value.display_name) textToTransform = value.display_name;
else textToTransform = value.acct.split('@')[0];
}
return this.emojiConverter.applyEmojis(value.emojis, textToTransform, EmojiTypeEnum.small)
return this.emojiConverter.applyEmojis(value.emojis, textToTransform, EmojiTypeEnum.small);
} catch (err){
return '';
}
}
}