fix(core): emit voice state from snapshots
This commit is contained in:
@@ -666,6 +666,7 @@ impl ChanoraSession {
|
||||
.await
|
||||
.map(|(_, channel)| JoinChannelId(channel));
|
||||
let epoch = state.join_state.authoritative.confirmed_epoch;
|
||||
let before = channel_join::project(&state.join_state);
|
||||
let _ = channel_join::reduce(
|
||||
&mut state.join_state,
|
||||
ChannelJoinEvent::SnapshotReady {
|
||||
@@ -674,6 +675,14 @@ impl ChanoraSession {
|
||||
now: std::time::Instant::now(),
|
||||
},
|
||||
);
|
||||
let projection = channel_join::project(&state.join_state);
|
||||
let should_emit_voice_state = projection != before;
|
||||
self.voice_selector
|
||||
.set_in_channel(projection.current_channel.is_some());
|
||||
drop(guard);
|
||||
if should_emit_voice_state {
|
||||
self.emit_voice_state(projection).await;
|
||||
}
|
||||
Ok(snap)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user