mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
fix(ui): always refresh contact data on path_changed event
The path_changed socket handler was skipping the refresh when Contact Info modal was closed. This meant contactsList stayed stale, so opening the modal later still showed outdated path info. Now always refreshes contactsList on any path_changed event. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -121,16 +121,9 @@ function connectChatSocket() {
|
||||
updateStatus(data.connected ? 'connected' : 'disconnected');
|
||||
});
|
||||
|
||||
// Real-time path change — refresh Contact Info if open for this contact
|
||||
// Real-time path change — always refresh contactsList, re-render modal if open
|
||||
chatSocket.on('path_changed', async (data) => {
|
||||
const modalEl = document.getElementById('dmContactInfoModal');
|
||||
if (!modalEl || !modalEl.classList.contains('show')) return;
|
||||
const currentPubkey = getCurrentContactPubkey();
|
||||
if (!currentPubkey) return;
|
||||
const changedKey = (data.public_key || '').toLowerCase();
|
||||
if (changedKey && changedKey.startsWith(currentPubkey.toLowerCase())) {
|
||||
await refreshContactInfoPath();
|
||||
}
|
||||
await refreshContactInfoPath();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user