updating relationships when changing accounts

This commit is contained in:
Nicolas Constant 2019-02-22 23:48:02 -05:00
parent f447f9c493
commit 3a0dc99783
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
2 changed files with 15 additions and 13 deletions

View File

@ -47,6 +47,7 @@ $header-height: 160px;
color: white;
}
&__follow{
// transition: all .4s;
position: absolute;
top: 10px;
right: 15px;

View File

@ -46,10 +46,8 @@ export class UserProfileComponent implements OnInit {
@Output() browseThreadEvent = new EventEmitter<OpenThreadEvent>();
@Input('currentAccount')
//set currentAccount(account: Account) {
set currentAccount(accountName: string) {
this.lastAccountName = accountName;
this.load(this.lastAccountName);
this.load(accountName);
}
constructor(
@ -62,10 +60,11 @@ export class UserProfileComponent implements OnInit {
}
ngOnInit() {
// this.currentlyUsedAccount = this.toolsService.getSelectedAccounts()[0];
this.accountSub = this.accounts$.subscribe((accounts: AccountInfo[]) => {
if (this.account) {
const userAccount = accounts.filter(x => x.isSelected)[0];
// this.load()
this.getFollowStatus(userAccount, this.account);
}
});
}
@ -78,12 +77,14 @@ export class UserProfileComponent implements OnInit {
this.account = null;
this.isLoading = true;
this.statusLoading = true;
this.lastAccountName = accountName;
this.currentlyUsedAccount = this.toolsService.getSelectedAccounts()[0];
return this.toolsService.findAccount(this.currentlyUsedAccount, accountName)
.then((account: Account) => {
this.isLoading = false;
this.statusLoading = true;
this.account = account;
this.hasNote = account && account.note && account.note !== '<p></p>';