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
11 changes: 9 additions & 2 deletions src/components/menu/ModalWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export default {
}
},
computed: {
...mapGetters('modal', ['getModalActive', 'getModalParams', 'getSecondsLeft']),
...mapGetters('modal', ['getModalActive', 'getModalParams', 'getSecondsLeft',
'getCountdownEnded']),
},
watch: {
// Watch params in store/modal, use to show/hide the menu and determine layout
Expand All @@ -72,7 +73,7 @@ export default {
},
methods: {
...mapMutations('modal', ['SETMODALACTIVE', 'RESETMODALPARAMS',
'STARTCOUNTDOWNTIMER']),
'STARTCOUNTDOWNTIMER', 'STOPCOUNTDOWNTIMER']),

async handleClick(callback) {
callback()
Expand All @@ -85,6 +86,12 @@ export default {
}
this.SETMODALACTIVE(false)
this.RESETMODALPARAMS()

// The user clicked outside of the timeout modal before the countdown ended
// which cancels the callback function that would have been called at 0.
if (this.getModalParams.type === 'timeout' && !this.getCountdownEnded) {
this.STOPCOUNTDOWNTIMER()
}
},
},
}
Expand Down
17 changes: 13 additions & 4 deletions src/views/ConfigurationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default {
},
methods: {
...mapMutations(['SETGAMEID']),
...mapActions('modal', ['alert']),
...mapActions('modal', ['alert', 'timeout']),

toggleMenu() {
this.menuActive = !this.menuActive
Expand All @@ -192,9 +192,18 @@ export default {

handleAxiosError(error) {
console.error(error)
if (error.response && error.response.status === 401) {
this.alert('Please log in again to continue.')
this.$router.push('entry')
if (error.response) {
if (error.response.status === 401) {
this.alert('Please log in again to continue.')
this.$router.push('entry')
} else if (error.response.status === 500) {
this.timeout({
message: 'Our servers are currently busy right now.\n' +
'Retrying in 10',
secondsLeft: 10,
timeoutCallback: () => { this.launchSimulation() },
})
}
} else {
this.alert(error)
}
Expand Down