Skip to content

Commit f7f8b3f

Browse files
More cleanup
1 parent 38014c3 commit f7f8b3f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Library/ViewModels/PledgeShippingLocationViewModel.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ public final class PledgeShippingLocationViewModel: PledgeShippingLocationViewMo
5555
.ignoreValues()
5656
.switchMap { _ in
5757
shippableLocations()
58-
.wrapInOptional()
59-
.demoteErrors(replaceErrorWith: nil)
6058
}
6159

6260
let loadedLocations = locations.skipNil()
@@ -178,12 +176,15 @@ private func determineShippingLocation(
178176
return defaultShippingLocation(fromLocations: locations)
179177
}
180178

181-
private func shippableLocations() -> SignalProducer<[Location], ErrorEnvelope> {
179+
private func shippableLocations() -> SignalProducer<[Location]?, Never> {
182180
let query = GraphAPI.ShippableLocationsQuery()
183-
let signal = AppEnvironment.current.apiService.fetch(query: query)
181+
let producer = AppEnvironment.current.apiService.fetch(query: query)
184182
.map { data in
185183
let locations = Location.locations(from: data)
186184
return locations
187185
}
188-
return signal
186+
187+
return producer
188+
.wrapInOptional()
189+
.demoteErrors(replaceErrorWith: nil)
189190
}

0 commit comments

Comments
 (0)