From 92fd28218449d8d1e9b0738ca481ed79edb82b96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Fri, 5 Jun 2020 19:36:47 +0200 Subject: [PATCH] MAPG-103 reset UI elements in case of error --- public/static/js/game.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/static/js/game.js b/public/static/js/game.js index 0305be2..4145750 100644 --- a/public/static/js/game.js +++ b/public/static/js/game.js @@ -28,14 +28,14 @@ var xhr = new XMLHttpRequest(); xhr.responseType = 'json'; xhr.onload = function () { + document.getElementById('loading').style.visibility = 'hidden'; + document.getElementById('cover').style.visibility = 'hidden'; + if (this.response.error) { //TODO: handle this error return; } - document.getElementById('loading').style.visibility = 'hidden'; - document.getElementById('cover').style.visibility = 'hidden'; - Game.panoId = this.response.panoId; if (this.response.history) {