File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,9 @@ struct WebSocket: ReducerProtocol {
112
112
. cancellable ( id: WebSocketID . self)
113
113
114
114
case . sendResponse( didSucceed: false ) :
115
- state. alert = AlertState ( title: TextState ( " Could not send socket message. Connect to the server first, and try again. " ) )
115
+ state. alert = AlertState (
116
+ title: TextState (
117
+ " Could not send socket message. Connect to the server first, and try again. " ) )
116
118
return . none
117
119
118
120
case . sendResponse( didSucceed: true ) :
@@ -146,10 +148,10 @@ struct WebSocketView: View {
146
148
VStack ( alignment: . leading) {
147
149
Button (
148
150
viewStore. connectivityState == . connected
149
- ? " Disconnect "
150
- : viewStore. connectivityState == . disconnected
151
- ? " Connect "
152
- : " Connecting... "
151
+ ? " Disconnect "
152
+ : viewStore. connectivityState == . disconnected
153
+ ? " Connect "
154
+ : " Connecting... "
153
155
) {
154
156
viewStore. send ( . connectButtonTapped)
155
157
}
@@ -176,8 +178,8 @@ struct WebSocketView: View {
176
178
Text ( " Status: \( viewStore. connectivityState. rawValue) " )
177
179
. foregroundStyle ( . secondary)
178
180
Text ( viewStore. receivedMessages. reversed ( ) . joined ( separator: " \n " ) )
179
- } header: {
180
- Text ( " Received messages " )
181
+ } header: {
182
+ Text ( " Received messages " )
181
183
}
182
184
}
183
185
. alert ( self . store. scope ( state: \. alert) , dismiss: . alertDismissed)
Original file line number Diff line number Diff line change @@ -92,7 +92,9 @@ final class WebSocketTests: XCTestCase {
92
92
$0. messageToSend = " "
93
93
}
94
94
await store. receive ( . sendResponse( didSucceed: false ) ) {
95
- $0. alert = AlertState ( title: TextState ( " Could not send socket message. Connect to the server first, and try again. " ) )
95
+ $0. alert = AlertState (
96
+ title: TextState (
97
+ " Could not send socket message. Connect to the server first, and try again. " ) )
96
98
}
97
99
98
100
// Disconnect from the socket
You can’t perform that action at this time.
0 commit comments