Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/popups/LogoutQuitConfirmationPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class LogoutQuitConfirmationPopup extends Component
<h1>Logout & Quit</h1>
<p>Are you sure you want to log out and quit?</p>
<a href="#" className="btn border-btn" onClick={this.onClosePopup.bind(this)}>Cancel</a>
<a href="#" className="btn border-btn primary" onClick={this.onSwitchSoldier.bind(this)}>Switch Soldier</a>
<a href="#" className="btn border-btn primary" onClick={this.onConfirmQuit.bind(this)}>Logout & Quit</a>
</div>
</div>
Expand All @@ -27,6 +28,15 @@ class LogoutQuitConfirmationPopup extends Component
WebUI.Call('LogoutQuit');
}

onSwitchSoldier(e)
{
if (e)
e.preventDefault();

this.props.closePopup();
WebUI.Call('LogoutPlayer');
}

onClosePopup(e)
{
if (e)
Expand Down
9 changes: 9 additions & 0 deletions app/reducers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ export default function user(state = initialState, action)
hashHistory.push('/main-menu');
}, 50);
}
else if(finalState.loginStatus === LoginStatus.LOGGED_IN &&
finalState.playerLoginStatus === PlayerLoginStatus.LOGGED_OUT &&
finalState.user !== null &&
finalState.players !== null)
{
setTimeout(function() {
hashHistory.push('/players');
}, 50);
}

return finalState;
}
Expand Down