newState and oldState on ConnectionStateUpdatedEvent
This commit is contained in:
@@ -592,7 +592,7 @@ class Engine extends Disposable with EventsEmittable<EngineEvent> {
|
||||
events.emit(event);
|
||||
})
|
||||
..on<SignalConnectionStateUpdatedEvent>((event) async {
|
||||
if (event.connectionState == ConnectionState.disconnected) {
|
||||
if (event.newState == ConnectionState.disconnected) {
|
||||
await _onDisconnected(DisconnectReason.signal);
|
||||
}
|
||||
// Relay to Room
|
||||
|
||||
@@ -152,10 +152,12 @@ class SignalClient extends Disposable with EventsEmittable<SignalEvent> {
|
||||
bool didReconnect = _connectionState == ConnectionState.reconnecting &&
|
||||
newValue == ConnectionState.connected;
|
||||
|
||||
final oldState = _connectionState;
|
||||
_connectionState = newValue;
|
||||
|
||||
events.emit(SignalConnectionStateUpdatedEvent(
|
||||
connectionState: _connectionState,
|
||||
newState: _connectionState,
|
||||
oldState: oldState,
|
||||
didReconnect: didReconnect,
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user