Add debug lines for fav click

This commit is contained in:
Jack Kingsman
2026-04-08 16:18:46 -07:00
parent 01c86a486e
commit 8e2e039985
6 changed files with 58 additions and 15 deletions

View File

@@ -12,7 +12,16 @@ export function mergeContactIntoList(contacts: Contact[], incoming: Contact): Co
const idx = contacts.findIndex((c) => c.public_key === incoming.public_key);
if (idx >= 0) {
const existing = contacts[idx];
const merged = { ...existing, ...incoming };
// Preserve user-action-only fields that should not be overwritten by
// radio-event-driven WS updates (adverts, path updates, syncs). These
// fields are only changed via explicit user actions (favorite toggle,
// mark-read) or full REST refetches, not via mesh/radio events.
const merged = {
...existing,
...incoming,
favorite: existing.favorite,
last_read_at: existing.last_read_at,
};
const unchanged = (Object.keys(merged) as (keyof Contact)[]).every(
(k) => existing[k] === merged[k]
);