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