mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-13 18:45:43 +05:00
Add notification for scalable server broadcast
This commit is contained in:
parent
5514dc7caa
commit
385d3ec2bb
@ -2507,6 +2507,25 @@ define([
|
||||
};
|
||||
};
|
||||
|
||||
common.checkCustomBroadcastScalable = () => {
|
||||
require(['/common/notify.js'], (Notify) => {
|
||||
const custom = AppConfig.customBroadcast;
|
||||
const viewedStr = localStorage.customBroadcastScalable;
|
||||
const viewed = viewedStr === "1";
|
||||
if (viewed) { return; }
|
||||
if (Array.isArray(custom)) {
|
||||
custom.forEach(obj => {
|
||||
if (obj.id !== "scalable2026") { return; }
|
||||
if (!obj.filter()) { return; }
|
||||
localStorage.customBroadcastScalable = "1";
|
||||
const lang = localStorage.CRYPTPAD_LANG;
|
||||
const msg = obj.msg[lang] || obj.msg.default;
|
||||
Notify.system('CryptPad.fr', msg)
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
common.ready = (function () {
|
||||
var env = {};
|
||||
var initialized = false;
|
||||
@ -2514,6 +2533,8 @@ define([
|
||||
return function (f, rdyCfg) {
|
||||
rdyCfg = rdyCfg || {};
|
||||
|
||||
common.checkCustomBroadcastScalable();
|
||||
|
||||
if (rdyCfg.currentPad) {
|
||||
currentPad = common.currentPad = rdyCfg.currentPad;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user