File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
site/twitch.tv/modules/chat Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { v4 as uuidv4 } from "uuid";
1515const { target } = useWorker ();
1616const ctx = useChannelContext ();
1717const channelID = toRef (ctx , " id" );
18+ const peerChannelIDs = toRef (ctx , " peerChannelIds" );
1819const messages = useChatMessages (ctx );
1920const emotes = useChatEmotes (ctx );
2021const { providers } = useStore ();
@@ -24,12 +25,12 @@ const channelSets = useLiveQuery(
2425 () =>
2526 db .channels
2627 .where (" id" )
27- .equals ( ctx .id )
28- .first ()
29- .then ((c ) => c ?.set_ids ?? []),
28+ .anyOf ([ ctx .id , ... ctx . peerChannelIds ] )
29+ .toArray ()
30+ .then ((res ) => res . flatMap (( c ) => c ?.set_ids ?? []) ),
3031 undefined ,
3132 {
32- reactives: [channelID ],
33+ reactives: [channelID , peerChannelIDs ],
3334 },
3435);
3536
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export class ChannelContext implements CurrentChannel {
1313 id = "" ;
1414 username = "" ;
1515 displayName = "" ;
16+ peerChannelIds : string [ ] = [ ] ;
1617 user ?: SevenTV . User ;
1718 loaded = false ;
1819 setsFetched = false ;
@@ -56,6 +57,10 @@ export class ChannelContext implements CurrentChannel {
5657 return true ;
5758 }
5859
60+ setPeerChannelIds ( ids : string [ ] | MapIterator < string > ) {
61+ this . peerChannelIds = [ ...ids ] ;
62+ }
63+
5964 leave ( ) : void {
6065 this . active = false ;
6166
Original file line number Diff line number Diff line change @@ -298,6 +298,9 @@ watch(
298298 sharedChannels .set (channelID , useChannelContext (channelID , true ));
299299 }
300300 }
301+
302+ // Update host channel context
303+ ctx .setPeerChannelIds (sharedChannels .keys ());
301304 },
302305 });
303306 },
You can’t perform that action at this time.
0 commit comments