Report failures where the operator can still see them
The 55 alert() calls carried the same suppression as the confirms, and go wrong in the worse direction: a silenced confirm makes a button do nothing, while a silenced alert lets the action run and says nothing about it failing. vvAlert returns a promise nobody has to await, so these converted by rename with no caller becoming async. The icon is inferred from the message rather than asked of fifty call sites, and an explicit type still wins.
This commit is contained in:
@@ -649,7 +649,7 @@ function _addToGroupModal(uid) {
|
||||
const user = _users.find(u => u.id === uid);
|
||||
const userGids= new Set((user?.groups||[]).map(g => g.id));
|
||||
const available = _groups.filter(g => !userGids.has(g.id));
|
||||
if (!available.length) { alert('User is already in all groups.'); return; }
|
||||
if (!available.length) { vvAlert('User is already in all groups.'); return; }
|
||||
const opts = available.map(g => `<option value="${g.id}">${_esc(g.displayName)}</option>`).join('');
|
||||
_modal(`<h3>Add to Group</h3>
|
||||
<div class="vv-au-field">
|
||||
@@ -936,7 +936,7 @@ document.getElementById('vv-au-panel-acl').addEventListener('click', async e =>
|
||||
btn.disabled = true; btn.textContent = 'Saving…';
|
||||
_post({ action:'authelia_save', rules: JSON.stringify(_rules), default_policy: dp }, r => {
|
||||
btn.disabled = false; btn.textContent = 'Save & Restart Authelia';
|
||||
if (!r.ok) { alert('Save failed: ' + (r.error||'unknown error')); return; }
|
||||
if (!r.ok) { vvAlert('Save failed: ' + (r.error||'unknown error')); return; }
|
||||
// brief visual confirmation
|
||||
btn.textContent = 'Saved ✓';
|
||||
setTimeout(() => { btn.textContent = 'Save & Restart Authelia'; }, 2000);
|
||||
|
||||
Reference in New Issue
Block a user