refactoring

This commit is contained in:
Nicolas Constant 2020-03-13 20:25:51 -04:00
parent a9350ff31b
commit 9aefdbe870
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 7 additions and 11 deletions

View File

@ -73,21 +73,17 @@ export class ActionBarComponent implements OnInit, OnDestroy {
}
ngOnInit() {
const status = this.statusWrapper.status;
this.displayedStatus = this.statusWrapper.status;
const account = this.statusWrapper.provider;
if (status.reblog) {
this.favoriteStatePerAccountId[account.id] = status.reblog.favourited;
this.bootedStatePerAccountId[account.id] = status.reblog.reblogged;
this.bookmarkStatePerAccountId[account.id] = status.reblog.bookmarked;
this.displayedStatus = status.reblog;
} else {
this.favoriteStatePerAccountId[account.id] = status.favourited;
this.bootedStatePerAccountId[account.id] = status.reblogged;
this.bookmarkStatePerAccountId[account.id] = status.bookmarked;
this.displayedStatus = status;
if(this.displayedStatus.reblog){
this.displayedStatus = this.displayedStatus.reblog;
}
this.favoriteStatePerAccountId[account.id] = this.displayedStatus.favourited;
this.bootedStatePerAccountId[account.id] = this.displayedStatus.reblogged;
this.bookmarkStatePerAccountId[account.id] = this.displayedStatus.bookmarked;
this.analyseMemoryStatus();
if (this.displayedStatus.visibility === 'direct') {