|
@@ -702,16 +702,26 @@
|
|
|
if (!card) return;
|
|
if (!card) return;
|
|
|
var here = mine !== null && list.indexOf(mine) !== -1;
|
|
var here = mine !== null && list.indexOf(mine) !== -1;
|
|
|
var others = otherBrowserCount();
|
|
var others = otherBrowserCount();
|
|
|
|
|
+ // Without a VAPID key (the app booted unkeyed and
|
|
|
|
|
+ // `spry keys` has not run) there is nothing to
|
|
|
|
|
+ // subscribe WITH: hide Enable and say why. An
|
|
|
|
|
+ // existing subscription can still be turned off,
|
|
|
|
|
+ // and the test probe reports the real reason.
|
|
|
|
|
+ var keyed = !!state().push_vapid_key;
|
|
|
var onBtn = card.querySelector('[data-bell-on]');
|
|
var onBtn = card.querySelector('[data-bell-on]');
|
|
|
var offBtn = card.querySelector('[data-bell-off]');
|
|
var offBtn = card.querySelector('[data-bell-off]');
|
|
|
var help = card.querySelector('[data-bell-help]');
|
|
var help = card.querySelector('[data-bell-help]');
|
|
|
var testBtn = card.querySelector('[data-push-test]');
|
|
var testBtn = card.querySelector('[data-push-test]');
|
|
|
hereNow = here;
|
|
hereNow = here;
|
|
|
- if (onBtn) onBtn.hidden = here;
|
|
|
|
|
|
|
+ if (onBtn) onBtn.hidden = here || !keyed;
|
|
|
if (offBtn) offBtn.hidden = !here;
|
|
if (offBtn) offBtn.hidden = !here;
|
|
|
if (testBtn) testBtn.hidden = !here;
|
|
if (testBtn) testBtn.hidden = !here;
|
|
|
if (help) {
|
|
if (help) {
|
|
|
- if (here) {
|
|
|
|
|
|
|
+ if (!keyed) {
|
|
|
|
|
+ help.textContent = '\u2014 notifications are not configured'
|
|
|
|
|
+ + ' on this server yet (no push keys \u2014 the operator'
|
|
|
|
|
+ + ' needs to run spry keys)';
|
|
|
|
|
+ } else if (here) {
|
|
|
help.textContent = others > 0
|
|
help.textContent = others > 0
|
|
|
? '\u2014 this browser receives question, RFC, review and waiting-on-drafts alerts; '
|
|
? '\u2014 this browser receives question, RFC, review and waiting-on-drafts alerts; '
|
|
|
+ others + ' other browser(s) are also subscribed; "Notify me" per task adds its start, failure and completion'
|
|
+ others + ' other browser(s) are also subscribed; "Notify me" per task adds its start, failure and completion'
|