Skip to content

Commit cc6663a

Browse files
author
Dave Conway-Jones
committed
only send disconnect toast once.
update readme
1 parent 071e13f commit cc6663a

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ ui: { path: 'ui', middleware: function (req, res, next) {
4545
},
4646
```
4747

48+
You can also set the dashboard to be read only by `ui: { readOnly: true }`. This does not stop the user interacting with the dashboard but does ignore all updates coming from the dashboard.
49+
4850
## Layout
4951

5052
The dashboard layout should be considered as a grid.

dist/dashboard.appcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ weather-icons-lite/fonts/weather-icons-lite.woff2
1818
NETWORK:
1919
*
2020

21-
# hash: 88de3435558d1fab8f72ba56e003f69890cffe47cbcbdf1121f84bfc5a9aeea3
21+
# hash: 3cdadf67e539c60570559fb3748c6e7669a2765d114b7145592fe131562325d8

dist/js/app.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ app.controller('MainController', ['$mdSidenav', '$window', 'UiEvents', '$locatio
8585
var audioSource;
8686
var voices = [];
8787
var tabId = 0;
88+
var disc = true;
8889

8990
function moveTab(d) {
9091
var len = main.menu.length;
@@ -141,6 +142,7 @@ app.controller('MainController', ['$mdSidenav', '$window', 'UiEvents', '$locatio
141142
$mdSidenav('left').close();
142143
}
143144
}
145+
144146
$scope.location = $location;
145147

146148
this.getMenuName = function (menu) {
@@ -372,6 +374,7 @@ app.controller('MainController', ['$mdSidenav', '$window', 'UiEvents', '$locatio
372374
main.selectedTab.link = $sce.trustAsResourceUrl(main.selectedTab.link);
373375
}
374376
$mdToast.hide();
377+
disc = false;
375378
processGlobals();
376379
events.emit('ui-change', prevTabIndex);
377380
hideTabsAndGroups();
@@ -486,11 +489,14 @@ app.controller('MainController', ['$mdSidenav', '$window', 'UiEvents', '$locatio
486489
});
487490

488491
events.on('disconnect', function(m) {
489-
$mdToast.show({
490-
template: '<md-toast><div class="md-toast-error">&#x2718; &nbsp; Connection lost</div></md-toast>',
491-
position: 'top right',
492-
hideDelay: 6000000
493-
});
492+
if (!disc) {
493+
$mdToast.show({
494+
template: '<md-toast><div class="md-toast-error">&#x2718; &nbsp; Connection lost</div></md-toast>',
495+
position: 'top right',
496+
hideDelay: 6000000
497+
});
498+
disc = true;
499+
}
494500
});
495501

496502
events.on('show-toast', function (msg) {

0 commit comments

Comments
 (0)