Skip to content

Commit

Permalink
Add "Return to Home" button if room doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb531 committed Sep 5, 2021
1 parent 00d177e commit cff178f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/scripts/components/dashboard-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ class DashboardControlsComponent {
onclick: () => this.leaveRoom() }, 'Leave Room'
) :

// If room does not exist, allow user to return to app home
this.session.status === 'roomNotFound' ? m('button', {
onclick: () => this.returnToHome() }, 'Return to Home'
) :

// If an online game is not in progress (i.e. it was ended early, or there
// is a winner/tie), allow the user to play again
this.session.socket && this.game.players.length === 2 && this.session.status !== 'connecting' && this.session.status !== 'watchingGame' && !this.session.disconnectedPlayer && !this.session.reconnectedPlayer && !this.session.disconnected ? [
Expand Down

0 comments on commit cff178f

Please sign in to comment.