File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
thunder/src/main/java/com/jeremy/thunder/internal Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,7 @@ class ThunderStateManager private constructor(
78
78
connectionListener.collectState().onEach {
79
79
when (it) {
80
80
Initialize -> Unit
81
- GetReady -> {
82
- _socketState .updateThunderState(ThunderState .CONNECTING )
83
- openConnection()
84
- }
81
+ GetReady -> openConnection()
85
82
ShutDown -> closeConnection()
86
83
}
87
84
}.launchIn(scope)
@@ -92,7 +89,6 @@ class ThunderStateManager private constructor(
92
89
networkState.networkStatus.onEach {
93
90
when (it) {
94
91
NetworkState .Available -> {
95
- _socketState .updateThunderState(ThunderState .CONNECTING )
96
92
openConnection()
97
93
}
98
94
@@ -158,6 +154,7 @@ class ThunderStateManager private constructor(
158
154
private lateinit var connectionJob: Job
159
155
private fun openConnection () {
160
156
if (socket == null ) {
157
+ _socketState .updateThunderState(ThunderState .CONNECTING )
161
158
socket = webSocketCore.create()
162
159
socket?.let { webSocket ->
163
160
webSocket.open()
You can’t perform that action at this time.
0 commit comments