From: Joseph Coffland Date: Thu, 11 Mar 2021 01:41:18 +0000 (-0800) Subject: Get rid of View not found page and redirect to control X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=afa803c9dbf0c3c21e434c3c28432c160ef4fa27;p=bbctrl-firmware Get rid of View not found page and redirect to control --- diff --git a/src/js/app.js b/src/js/app.js index 9512d29..6b55cb7 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -115,7 +115,6 @@ module.exports = new Vue({ components: { 'estop': {template: '#estop-template'}, - 'view-not-found': {template: '

Error: View not found

'}, 'view-loading': {template: '

Loading...

'}, 'view-control': require('./view-control'), 'view-viewer': require('./view-viewer'), @@ -312,10 +311,12 @@ module.exports = new Vue({ var parts = hash.split(':'); - if (typeof this.$options.components['view-' + parts[0]] == 'undefined') - this.currentView = 'not-found'; + if (typeof this.$options.components['view-' + parts[0]] == 'undefined') { + location.hash = 'control'; + return; + + } else this.currentView = parts[0]; - else this.currentView = parts[0]; },