Skip to content

Commit 374dd25

Browse files
mbrandonwp4checo
authored andcommitted
Run swift-format
(cherry picked from commit 847b47043ce9ef340006030e6dad93997ee18b25)
1 parent 5060914 commit 374dd25

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Examples/CaseStudies/SwiftUICaseStudies/02-Effects-WebSocket.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ struct WebSocket: ReducerProtocol {
112112
.cancellable(id: WebSocketID.self)
113113

114114
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."))
116118
return .none
117119

118120
case .sendResponse(didSucceed: true):
@@ -146,10 +148,10 @@ struct WebSocketView: View {
146148
VStack(alignment: .leading) {
147149
Button(
148150
viewStore.connectivityState == .connected
149-
? "Disconnect"
150-
: viewStore.connectivityState == .disconnected
151-
? "Connect"
152-
: "Connecting..."
151+
? "Disconnect"
152+
: viewStore.connectivityState == .disconnected
153+
? "Connect"
154+
: "Connecting..."
153155
) {
154156
viewStore.send(.connectButtonTapped)
155157
}
@@ -176,8 +178,8 @@ struct WebSocketView: View {
176178
Text("Status: \(viewStore.connectivityState.rawValue)")
177179
.foregroundStyle(.secondary)
178180
Text(viewStore.receivedMessages.reversed().joined(separator: "\n"))
179-
} header: {
180-
Text("Received messages")
181+
} header: {
182+
Text("Received messages")
181183
}
182184
}
183185
.alert(self.store.scope(state: \.alert), dismiss: .alertDismissed)

Examples/CaseStudies/SwiftUICaseStudiesTests/02-Effects-WebSocketTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ final class WebSocketTests: XCTestCase {
9292
$0.messageToSend = ""
9393
}
9494
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."))
9698
}
9799

98100
// Disconnect from the socket

0 commit comments

Comments
 (0)