mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-08-09 18:23:11 +02:00
fix(chat): use showNotification instead of showToast in chat actions
showToast is only defined in contacts.js, not app.js. The chat page uses showNotification. The ReferenceError was silently caught, preventing loadBlockedNames() and loadMessages() from executing after blocking. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1041,12 +1041,12 @@ async function ignoreContactFromChat(pubkey) {
|
||||
});
|
||||
const data = await response.json();
|
||||
if (data.success) {
|
||||
showToast(data.message, 'info');
|
||||
showNotification(data.message, 'info');
|
||||
} else {
|
||||
showToast('Failed: ' + data.error, 'danger');
|
||||
showNotification('Failed: ' + data.error, 'danger');
|
||||
}
|
||||
} catch (err) {
|
||||
showToast('Network error', 'danger');
|
||||
showNotification('Network error', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1072,16 +1072,16 @@ async function blockContactFromChat(senderName) {
|
||||
}
|
||||
const data = await response.json();
|
||||
if (data.success) {
|
||||
showToast(data.message, 'warning');
|
||||
showNotification(data.message, 'warning');
|
||||
// Update blocked names then reload messages to hide blocked sender
|
||||
await loadBlockedNames();
|
||||
await loadMessages();
|
||||
} else {
|
||||
showToast('Failed: ' + data.error, 'danger');
|
||||
showNotification('Failed: ' + data.error, 'danger');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Error blocking contact from chat:', err);
|
||||
showToast('Network error', 'danger');
|
||||
showNotification('Network error', 'danger');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user