Refresh collaboration state from realtime events
This commit is contained in:
@@ -390,6 +390,9 @@
|
||||
if (activity.event_type === 'twitch.channel.chat.message' && activity.payload?.message?.text) {
|
||||
chatMessages = [{ event_id: activity.event_id, message_id: activity.payload.message_id ?? activity.event_id, user_id: activity.payload.chatter_user_id ?? '', user_name: activity.payload.chatter_user_name ?? 'unknown', text: activity.payload.message.text, fragments: (activity.payload.message.fragments ?? []).map((fragment) => ({ type: fragment.type, text: fragment.text, emote_id: fragment.emote?.id })), sent_at: activity.occurred_at, reply_parent_message_id: activity.payload.reply?.parent_message_id }, ...chatMessages].slice(0, 100);
|
||||
}
|
||||
if (activity.event_type.startsWith('twitch.channel.shared_chat.') || activity.event_type.startsWith('twitch.channel.guest_star_')) {
|
||||
void loadCollaboration();
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
realtimeState = 'DISCONNECTED';
|
||||
|
||||
Reference in New Issue
Block a user