From 82b55d450eac523511da6e646b9cb9d0e58b0979 Mon Sep 17 00:00:00 2001 From: MarekWo Date: Tue, 10 Mar 2026 21:31:58 +0100 Subject: [PATCH] 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 --- app/static/js/app.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/static/js/app.js b/app/static/js/app.js index f583da4..88af604 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -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'); } }