Skip to content

Commit

Permalink
Show an error when a devices refresh fails
Browse files Browse the repository at this point in the history
  • Loading branch information
incon committed Nov 4, 2017
1 parent 45865b8 commit 48de6cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions resources/assets/js/components/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ $(function () {
let devicesElm = $('.devices');
let errorElm = $('.error');

if (errorElm.is(":visible")) {
errorElm.hide();
loadingElm.show();
}

$.ajax({
url: '/api/devices',
type: 'GET'
Expand All @@ -37,6 +42,7 @@ $(function () {
devicesElm.show();

}).fail(function (response) {
devicesElm.hide();
errorElm.show();

}).always(function (response) {
Expand Down

0 comments on commit 48de6cc

Please sign in to comment.