Added disconnection notice and smart disconnect
This commit is contained in:
@@ -54,3 +54,4 @@ iron:router
|
|||||||
littledata:synced-cron
|
littledata:synced-cron
|
||||||
montiapm:agent
|
montiapm:agent
|
||||||
zodern:standard-minifier-js
|
zodern:standard-minifier-js
|
||||||
|
mixmax:smart-disconnect
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ meteor-base@1.4.0
|
|||||||
meteorhacks:subs-manager@1.6.4
|
meteorhacks:subs-manager@1.6.4
|
||||||
minifier-css@1.5.3
|
minifier-css@1.5.3
|
||||||
minimongo@1.6.0
|
minimongo@1.6.0
|
||||||
|
mixmax:smart-disconnect@0.0.4
|
||||||
mobile-experience@1.1.0
|
mobile-experience@1.1.0
|
||||||
mobile-status-bar@1.1.0
|
mobile-status-bar@1.1.0
|
||||||
modern-browsers@0.1.5
|
modern-browsers@0.1.5
|
||||||
|
|||||||
@@ -5,6 +5,19 @@
|
|||||||
</app-drawer>
|
</app-drawer>
|
||||||
{{> yield}}
|
{{> yield}}
|
||||||
</app-drawer-layout>
|
</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">
|
<paper-toast id="global-toast" duration="5000">
|
||||||
{{> Template.dynamic template=globalToastTemplate data=globalToastData }}
|
{{> Template.dynamic template=globalToastTemplate data=globalToastData }}
|
||||||
</paper-toast>
|
</paper-toast>
|
||||||
|
|||||||
@@ -2,6 +2,16 @@ Template.layout.onCreated(function() {
|
|||||||
this.subscribe("user");
|
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({
|
Template.appDrawer.helpers({
|
||||||
profileLink: function() {
|
profileLink: function() {
|
||||||
var user = Meteor.user();
|
var user = Meteor.user();
|
||||||
|
|||||||
Reference in New Issue
Block a user