aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-17 23:26:24 -0700
committerAdam Soltys <[email protected]>2026-08-17 23:26:24 -0700
commit8dc9498eb83f503edb6bdc18f7f640b80ad80153 (patch)
tree23688f644759b1337bf6c1843e0ff897a4be6a4e /src/features
parent83c39c7b2d0d022fd3f55ca1e6475d88f1021926 (diff)
downloadcoinosv3-8dc9498eb83f503edb6bdc18f7f640b80ad80153.tar.gz
coinosv3-8dc9498eb83f503edb6bdc18f7f640b80ad80153.zip
A full profile fetch outranks the day-old cache: the freshest kind 0 stamps the light cache and repaints the header, so a face changed elsewhere shows up in seconds instead of after the TTL
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src/features')
-rw-r--r--src/features/messages.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js
index f5e647b..a89854a 100644
--- a/src/features/messages.js
+++ b/src/features/messages.js
@@ -1100,8 +1100,15 @@ export function messagesFeature(ctx) {
try { m = newest ? JSON.parse(newest.content) : {}; } catch {}
fullProfiles.set(pk, m);
persistPage('full', pk, m);
- profiles.set(pk, { name: m.display_name || m.name || null, picture: m.picture || null });
+ // A full fetch is the freshest word on this profile — stamp it into the
+ // light cache (and persist) so a picture changed elsewhere replaces the
+ // stale one everywhere within a session, not after the 24h TTL. The
+ // repaint covers the header/chat avatars, not just an open profile page.
+ const entry = { name: m.display_name || m.name || null, picture: m.picture || null, t: Date.now() };
+ profiles.set(pk, entry);
+ persistProfile(pk, entry);
if (ui.profilePk === pk) render();
+ else scheduleRepaint();
}).catch(() => { if (!fullProfiles.has(pk)) fullProfiles.set(pk, {}); });
}