mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-29 08:20:21 +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() {
|
render() {
|
||||||
const { accounts, skin, allowAdd, allowLogout, highlightActiveAccount } = this.props;
|
const { accounts, skin, allowAdd, allowLogout, highlightActiveAccount } = this.props;
|
||||||
|
const activeAccount = accounts.active;
|
||||||
|
|
||||||
let {available} = accounts;
|
let {available} = accounts;
|
||||||
|
|
||||||
if (highlightActiveAccount) {
|
if (highlightActiveAccount) {
|
||||||
available = available.filter((account) => account.id !== accounts.active.id);
|
available = available.filter((account) => account.id !== activeAccount.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -65,19 +66,19 @@ export class AccountSwitcher extends Component {
|
|||||||
)} />
|
)} />
|
||||||
<div className={styles.activeAccountInfo}>
|
<div className={styles.activeAccountInfo}>
|
||||||
<div className={styles.activeAccountUsername}>
|
<div className={styles.activeAccountUsername}>
|
||||||
{accounts.active.username}
|
{activeAccount.username}
|
||||||
</div>
|
</div>
|
||||||
<div className={classNames(styles.accountEmail, styles.activeAccountEmail)}>
|
<div className={classNames(styles.accountEmail, styles.activeAccountEmail)}>
|
||||||
{accounts.active.email}
|
{activeAccount.email}
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.links}>
|
<div className={styles.links}>
|
||||||
<div className={styles.link}>
|
<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} />
|
<Message {...messages.goToEly} />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.link}>
|
<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} />
|
<Message {...messages.logout} />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,6 +33,10 @@ export default class User {
|
|||||||
// frontend app specific attributes
|
// frontend app specific attributes
|
||||||
isGuest: true,
|
isGuest: true,
|
||||||
goal: null, // the goal with wich user entered site
|
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) => {
|
const user = Object.keys(defaults).reduce((user, key) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user