Merge pull request #227 from NicolasConstant/develop

0.20.1 PR
This commit is contained in:
Nicolas Constant 2020-02-25 21:17:27 -05:00 committed by GitHub
commit c804fbce68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sengi",
"version": "0.20.0",
"version": "0.20.1",
"license": "AGPL-3.0-or-later",
"main": "main-electron.js",
"description": "A multi-account desktop client for Mastodon and Pleroma",

View File

@ -22,7 +22,7 @@ export class AddNewAccountComponent implements OnInit {
private instance: string;
@Input()
set setInstance(value: string) {
this.instance = value;
this.instance = value.trim();
this.checkComrad();
}
get setInstance(): string {

View File

@ -92,7 +92,7 @@
<a href class="status__content-warning" *ngIf="isContentWarned" title="show content"
(click)="removeContentWarning()">
<span class="status__content-warning--title">sensitive content</span>
{{ contentWarningText }}
<span innerHTML="{{ contentWarningText }}"></span>
</a>
<app-databinded-text class="status__content" *ngIf="!isContentWarned" [text]="statusContent"
(accountSelected)="accountSelected($event)" (hashtagSelected)="hashtagSelected($event)"

View File

@ -97,7 +97,7 @@ export class StatusComponent implements OnInit {
private checkContentWarning(status: Status) {
if (status.sensitive || status.spoiler_text) {
this.isContentWarned = true;
this.contentWarningText = status.spoiler_text;
this.contentWarningText = this.emojiConverter.applyEmojis(this.displayedStatus.emojis, status.spoiler_text, EmojiTypeEnum.medium);
}
}

View File

@ -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 !== '<p></p>';
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('<a href="') && !f.value.includes('target="_blank"')){
f.value = f.value.replace('<a href="', '<a target="_blank" href="');
}
});
}
return acc;
}
private getPinnedStatuses(userAccount: AccountInfo, account: Account): Promise<void> {
return this.mastodonService.getAccountStatuses(userAccount, account.id, false, true, false, null, null, 20)
.then((statuses: Status[]) => {