Need to read the values too for PN alerts

Reference: #1032
This commit is contained in:
Lim Chee Aun 2025-01-23 09:46:47 +08:00
parent 0586194dcc
commit 2b05784a37

View file

@ -984,10 +984,10 @@ function PushNotificationsSection({ onClose }) {
const policyEl = elements.namedItem('policy');
if (policyEl) policyEl.value = policy;
// alerts is {}, iterate it
Object.keys(alerts).forEach((alert) => {
Object.entries(alerts).forEach(([alert, value]) => {
const el = elements.namedItem(alert);
if (el?.type === 'checkbox') {
el.checked = true;
el.checked = !!value;
}
});
}