broadcast fixes

pull/1/head
yflory 4 years ago
parent 8f679c141c
commit 875cee7b32

@ -1381,6 +1381,14 @@ define([
});
refresh();
Common.makeUniversal('broadcast', {
onEvent: function (obj) {
var cmd = obj.ev;
if (cmd !== "MAINTENANCE") { return; }
refresh();
}
});
return $div;
};
create['survey'] = function () {
@ -1435,7 +1443,9 @@ define([
return;
}
// Maintenance applied, send notification
common.mailbox.sendTo('BROADCAST_SURVEY', {}, {}, function (err, data) {
common.mailbox.sendTo('BROADCAST_SURVEY', {
url: data
}, {}, function (err, data) {
refresh();
checkLastBroadcastHash();
});
@ -1465,6 +1475,14 @@ define([
});
refresh();
Common.makeUniversal('broadcast', {
onEvent: function (obj) {
var cmd = obj.ev;
if (cmd !== "SURVEY") { return; }
refresh();
}
});
return $div;
};

@ -697,6 +697,7 @@ define([
var activeSurvey;
handlers['BROADCAST_SURVEY'] = function (ctx, box, data, cb) {
var msg = data.msg;
var content = msg.content;
var uid = msg.uid;
var old = activeSurvey;
activeSurvey = {
@ -704,7 +705,8 @@ define([
hash: data.hash
};
ctx.Store.onSurveyUpdate(uid);
cb(false, old);
var dismiss = !content.url;
cb(dismiss, old);
};
var activeCustom
handlers['BROADCAST_CUSTOM'] = function (ctx, box, data, cb) {

Loading…
Cancel
Save