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:
MarekWo
2026-03-10 21:31:58 +01:00
parent e1ceff3a65
commit 82b55d450e
+6 -6
View File
@@ -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');
}
}