diff --git a/src/components/menu/ModalWindow.vue b/src/components/menu/ModalWindow.vue index a709a86bb..66e53f75d 100644 --- a/src/components/menu/ModalWindow.vue +++ b/src/components/menu/ModalWindow.vue @@ -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 @@ -72,7 +73,7 @@ export default { }, methods: { ...mapMutations('modal', ['SETMODALACTIVE', 'RESETMODALPARAMS', - 'STARTCOUNTDOWNTIMER']), + 'STARTCOUNTDOWNTIMER', 'STOPCOUNTDOWNTIMER']), async handleClick(callback) { callback() @@ -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() + } }, }, } diff --git a/src/views/ConfigurationView.vue b/src/views/ConfigurationView.vue index 96ccb6940..a1001e484 100644 --- a/src/views/ConfigurationView.vue +++ b/src/views/ConfigurationView.vue @@ -167,7 +167,7 @@ export default { }, methods: { ...mapMutations(['SETGAMEID']), - ...mapActions('modal', ['alert']), + ...mapActions('modal', ['alert', 'timeout']), toggleMenu() { this.menuActive = !this.menuActive @@ -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) }