From 5731962603a5a4134cd4c2d23186622e23804950 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Mon, 24 Feb 2020 20:42:18 -0500 Subject: [PATCH] clean pleroma account's fields url, fix #200 --- .../stream/user-profile/user-profile.component.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/components/stream/user-profile/user-profile.component.ts b/src/app/components/stream/user-profile/user-profile.component.ts index cd5a35b2..e4fe07db 100644 --- a/src/app/components/stream/user-profile/user-profile.component.ts +++ b/src/app/components/stream/user-profile/user-profile.component.ts @@ -157,7 +157,7 @@ export class UserProfileComponent implements OnInit { this.isLoading = false; this.statusLoading = true; - this.displayedAccount = account; + this.displayedAccount = this.fixPleromaFieldsUrl(account); this.hasNote = account && account.note && account.note !== '

'; if (this.hasNote) { this.note = this.emojiConverter.applyEmojis(account.emojis, account.note, EmojiTypeEnum.medium); @@ -178,6 +178,18 @@ export class UserProfileComponent implements OnInit { }); } + private fixPleromaFieldsUrl(acc: Account): Account { + if(acc.fields){ + acc.fields.forEach(f => { + if(f.value.includes('