updating relationships when changing accounts
This commit is contained in:
parent
f447f9c493
commit
3a0dc99783
|
@ -47,6 +47,7 @@ $header-height: 160px;
|
|||
color: white;
|
||||
}
|
||||
&__follow{
|
||||
// transition: all .4s;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 15px;
|
||||
|
|
|
@ -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>';
|
||||
|
|
Loading…
Reference in New Issue