Add notification for scalable server broadcast

This commit is contained in:
yflory 2026-03-02 16:41:14 +01:00
parent 5514dc7caa
commit 385d3ec2bb

View File

@ -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;
}