diff options
| author | Adam Soltys <[email protected]> | 2026-08-15 16:09:04 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-15 16:09:04 -0700 |
| commit | dac0a038f83825b97dc95d5a52d229e9049ca499 (patch) | |
| tree | 0e2f0275ff3f1f297daad0c6424b29678b7ae8d1 /src | |
| parent | 36355aa9e6e5ea65a73fc00fb7ea2b0db118962d (diff) | |
| download | coinosv3-dac0a038f83825b97dc95d5a52d229e9049ca499.tar.gz coinosv3-dac0a038f83825b97dc95d5a52d229e9049ca499.zip | |
The header avatar builds fresh each render — the cached-node trick predates the morph, which both obsoleted it and was emptying it
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014tE4U5nEjGTQy8PwYqamfv
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/messages.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 70407ad..d137b91 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -2086,13 +2086,11 @@ export function messagesFeature(ctx) { // 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; + // A fresh node every render: the morph keeps the live element (and its + // loaded image) in place when nothing changed, which is exactly what + // the old cached-node trick faked — and reusing one node in two trees + // let the morph strip its children when positions paired it wrong. + return avatar(pk, 'chat-avatar header-ava', false); }, // Conversations waiting on us, for the header's message button. unreadMessages() { return unreadCount(); }, |
