Added disconnection notice and smart disconnect
This commit is contained in:
@@ -5,6 +5,19 @@
|
||||
</app-drawer>
|
||||
{{> yield}}
|
||||
</app-drawer-layout>
|
||||
{{#if disconnected}}
|
||||
<div style="
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 00;
|
||||
right: 0;
|
||||
padding: 4px;
|
||||
background: rgb(209 59 46);;
|
||||
color: white;
|
||||
text-align: center;">
|
||||
Disconnected, changes won't be saved. {{#if connectionStatus}}({{connectionStatus}}){{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<paper-toast id="global-toast" duration="5000">
|
||||
{{> Template.dynamic template=globalToastTemplate data=globalToastData }}
|
||||
</paper-toast>
|
||||
|
||||
@@ -2,6 +2,16 @@ Template.layout.onCreated(function() {
|
||||
this.subscribe("user");
|
||||
});
|
||||
|
||||
Template.layout.helpers({
|
||||
connectionStatus: function(){
|
||||
let status = Meteor.status()
|
||||
return status.reason || status.status;
|
||||
},
|
||||
disconnected: function(){
|
||||
return !Meteor.status().connected;
|
||||
},
|
||||
});
|
||||
|
||||
Template.appDrawer.helpers({
|
||||
profileLink: function() {
|
||||
var user = Meteor.user();
|
||||
|
||||
Reference in New Issue
Block a user