fix(chat): restore channel assets when leaving shared chat

When a shared chat session ended, the participants' merged emotes and badges
stayed in the channel asset maps, so the other streamer's emote set and badges
kept showing (#522). Only the enter transition was handled.

Detect the leave transition (was shared, no longer shared) and reset: clear the
loaded-participant tracking and re-run getAssets(), which replaces the channel
emote/badge maps with this channel's own assets. Guarded on having actually
loaded shared assets so a flapping source-room-id tag can't cause redundant
refetches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tommy Chow 2026-06-08 22:42:37 -07:00
parent 29c4f74ef5
commit f5718e3656
2 changed files with 22 additions and 0 deletions

View file

@ -611,6 +611,16 @@ abstract class ChatStoreBase with Store {
showFFZEmotes: settings.showFFZEmotes,
showFFZBadges: settings.showFFZBadges,
);
} else if (wasShared &&
!_isInSharedChatMode &&
assetsStore.hasLoadedSharedChatAssets) {
// On leaving shared chat, drop the participants' merged emotes and
// badges and restore just this channel's assets — otherwise the
// other streamer's emote set and badges linger (#522). Guarded on
// having actually loaded shared assets so a flapping tag can't
// trigger redundant refetches.
assetsStore.resetSharedChatAssets();
getAssets();
}
messageBuffer.add(parsedIRCMessage);
break;