Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oskar/handle_404_account_switch #114

Merged
merged 10 commits into from
Jun 12, 2019
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ContractTypeCell from 'App/Components/Elements/PositionsDrawer/contr
import ProgressSlider from 'App/Components/Elements/PositionsDrawer/ProgressSlider';
import { getTimePercentage } from 'App/Components/Elements/PositionsDrawer/helpers';
import ProfitLossCardContent from 'Modules/Reports/Components/profit-loss-card-content.jsx';
import routes from 'Constants/routes';
OskarAhl marked this conversation as resolved.
Show resolved Hide resolved
import ContractCardBody from './contract-card-body.jsx';
import ContractCardFooter from './contract-card-footer.jsx';
import ContractCardHeader from './contract-card-header.jsx';
Expand Down Expand Up @@ -171,7 +172,7 @@ class ContractDrawer extends Component {
<div className={classNames('contract-drawer', {})}>
<div
className='contract-drawer__heading'
onClick={() => this.props.history.goBack()}
onClick={() => this.props.history.push(routes.reports)}
OskarAhl marked this conversation as resolved.
Show resolved Hide resolved
>
<Icon icon={IconBack} />
<h2><Localize str={this.props.heading || 'Contract'} /></h2>
Expand Down
5 changes: 5 additions & 0 deletions src/javascript/app/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ export default class ClientStore extends BaseStore {
switchAccount(loginid) {
this.root_store.ui.removeAllNotifications();
this.switched = loginid;

if (location.pathname.includes('contract')) {
this.root_store.modules.contract.onUnmountReplay();
location.reload();
OskarAhl marked this conversation as resolved.
Show resolved Hide resolved
}
}

@action.bound
Expand Down