mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-28 16:00:24 +05:30
Restore accounts backward compatibility
This commit is contained in:
parent
9fb7d62a21
commit
2653085f57
@ -44,11 +44,12 @@ export class AccountSwitcher extends Component {
|
||||
|
||||
render() {
|
||||
const { accounts, skin, allowAdd, allowLogout, highlightActiveAccount } = this.props;
|
||||
const activeAccount = accounts.active;
|
||||
|
||||
let {available} = accounts;
|
||||
|
||||
if (highlightActiveAccount) {
|
||||
available = available.filter((account) => account.id !== accounts.active.id);
|
||||
available = available.filter((account) => account.id !== activeAccount.id);
|
||||
}
|
||||
|
||||
return (
|
||||
@ -65,19 +66,19 @@ export class AccountSwitcher extends Component {
|
||||
)} />
|
||||
<div className={styles.activeAccountInfo}>
|
||||
<div className={styles.activeAccountUsername}>
|
||||
{accounts.active.username}
|
||||
{activeAccount.username}
|
||||
</div>
|
||||
<div className={classNames(styles.accountEmail, styles.activeAccountEmail)}>
|
||||
{accounts.active.email}
|
||||
{activeAccount.email}
|
||||
</div>
|
||||
<div className={styles.links}>
|
||||
<div className={styles.link}>
|
||||
<a href={`http://ely.by/u${accounts.active.id}`} target="_blank">
|
||||
<a href={`http://ely.by/u${activeAccount.id}`} target="_blank">
|
||||
<Message {...messages.goToEly} />
|
||||
</a>
|
||||
</div>
|
||||
<div className={styles.link}>
|
||||
<a className={styles.link} onClick={this.onRemove(accounts.active)} href="#">
|
||||
<a className={styles.link} onClick={this.onRemove(activeAccount)} href="#">
|
||||
<Message {...messages.logout} />
|
||||
</a>
|
||||
</div>
|
||||
|
@ -33,6 +33,10 @@ export default class User {
|
||||
// frontend app specific attributes
|
||||
isGuest: true,
|
||||
goal: null, // the goal with wich user entered site
|
||||
|
||||
// TODO: remove me after migration to multy accs
|
||||
token: '',
|
||||
refreshToken: ''
|
||||
};
|
||||
|
||||
const user = Object.keys(defaults).reduce((user, key) => {
|
||||
|
Loading…
Reference in New Issue
Block a user