Get rid of View not found page and redirect to control
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Thu, 11 Mar 2021 01:41:18 +0000 (17:41 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Thu, 11 Mar 2021 01:41:18 +0000 (17:41 -0800)
src/js/app.js

index 9512d293fc0d664410daea3de6e0c9bd2a036c0b..6b55cb778adee879418be185fa80aaf8ad498a48 100644 (file)
@@ -115,7 +115,6 @@ module.exports = new Vue({
 
   components: {
     'estop':          {template: '#estop-template'},
-    'view-not-found': {template: '<h1>Error: View not found</h1>'},
     'view-loading':   {template: '<h1>Loading...</h1>'},
     '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];
     },