#48: add loader during account switching

This commit is contained in:
SleepWalker
2016-11-19 11:34:19 +02:00
parent 1449d1ac79
commit 78132e9adb
3 changed files with 16 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import classNames from 'classnames';
import { Link } from 'react-router';
import { FormattedMessage as Message } from 'react-intl';
import loader from 'services/loader';
import { skins, SKIN_DARK, COLOR_WHITE } from 'components/ui';
import { Button } from 'components/ui/form';
@@ -137,9 +138,12 @@ export class AccountSwitcher extends Component {
onSwitch = (account) => (event) => {
event.preventDefault();
loader.show();
this.props.switchAccount(account)
.then(() => this.props.onAfterAction())
.then(() => this.props.onSwitch(account));
.then(() => this.props.onSwitch(account))
.finally(() => loader.hide());
};
onRemove = (account) => (event) => {