diff --git a/src/components/World/World.js b/src/components/World/World.js index 154244ea..43518e77 100644 --- a/src/components/World/World.js +++ b/src/components/World/World.js @@ -32,7 +32,7 @@ function createLight() { } class World { - constructor(container) { + constructor(container, vue) { this.update = this.update.bind(this); // Instances of camera, scene, and renderer @@ -72,7 +72,7 @@ class World { this.scene.add(light, terrain); - this.loadClaims(); + this.loadClaims(vue); requestAnimationFrame(this.update); @@ -95,7 +95,7 @@ class World { requestAnimationFrame(this.update); } - async loadClaims() { + async loadClaims(vue) { const endorserApiServer = AppString.DEFAULT_ENDORSER_API_SERVER; try { const url = @@ -191,21 +191,21 @@ class World { } } else { console.log( - "Got bad response status & data of", + "Got bad server response status & data of", resp.status, resp.data ); - // this.alertTitle = "Error With Server"; - // this.alertMessage = - // "Got an error retrieving your given time from the server."; - // this.isAlertVisible = true; + vue.setAlert( + "Error With Server", + "There was an error retrieving your claims from the server." + ); } } catch (error) { - console.log("Got error of", error); - // this.alertTitle = "Error With Server"; - // this.alertMessage = - // "Got an error retrieving your given time from the server."; - // this.isAlertVisible = true; + console.log("Got exception contacting server:", error); + vue.setAlert( + "Error With Server", + "There was a problem retrieving your claims from the server." + ); } } diff --git a/src/views/StatisticsView.vue b/src/views/StatisticsView.vue index e1281c97..6cbb763a 100644 --- a/src/views/StatisticsView.vue +++ b/src/views/StatisticsView.vue @@ -58,6 +58,17 @@
+ +{{ alertMessage }}
+