diff options
| author | Adam Soltys <[email protected]> | 2026-08-04 01:32:31 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-04 01:32:31 -0700 |
| commit | 8bfec51dd0eb8a4935ad62ce444f1d9d67c8105c (patch) | |
| tree | cd431c67f4c26e3e5c53c75f05a03d15f57256c8 /src/features/messages.js | |
| parent | cdbdc9b509d14ba386e01ecb87a80e54ef28addb (diff) | |
| download | coinosv3-8bfec51dd0eb8a4935ad62ce444f1d9d67c8105c.tar.gz coinosv3-8bfec51dd0eb8a4935ad62ce444f1d9d67c8105c.zip | |
A quieter pen inside the address box; the header avatar stops flashing
The avatar img was recreated on every render — boot's render bursts made
it flash; there is exactly one header avatar, so the node is reused until
the profile actually changes.
Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/features/messages.js')
| -rw-r--r-- | src/features/messages.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 8fbc27a..3854f26 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -1660,7 +1660,19 @@ export function messagesFeature(ctx) { // Chat lives behind a header button and takes over the whole screen — // no balance card, no tabs; each view carries its own way back. // The bare avatar node for the app header's identity menu. - headerAvatar(pk) { return avatar(pk, 'chat-avatar header-ava', false); }, + // The header rebuilds every render; recreating the <img> each time makes + // the picture visibly flash during boot's render bursts. There is exactly + // one header avatar, so the node itself is reused until the profile + // (or account) actually changes. + headerAvatar(pk) { + const p = profileOf(pk); + const key = pk + '|' + (p === null ? 'loading' : p.picture || 'fb:' + (p.name || '')); + if (!this._headerAva || this._headerAvaKey !== key) { + this._headerAvaKey = key; + this._headerAva = avatar(pk, 'chat-avatar header-ava', false); + } + return this._headerAva; + }, // Conversations waiting on us, for the header's message button. unreadMessages() { return unreadCount(); }, screenView() { |
