Skip to content

Commit bf548b2

Browse files
committed
remove warnings
1 parent 167d53b commit bf548b2

File tree

20 files changed

+170
-156
lines changed

20 files changed

+170
-156
lines changed

CriticalMapsKit/Package.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,6 @@ package.targets.append(contentsOf: [
375375
.testHelper,
376376
.tca,
377377
.product(name: "MastodonKit", package: "MastodonKit")
378-
],
379-
exclude: [
380-
"__Snapshots__"
381378
]
382379
)
383380
])

CriticalMapsKit/Sources/AppFeature/RideEventView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ struct RideEventView: View {
5858
),
5959
slug: nil,
6060
title: "CriticalMaps Berlin",
61-
description: "Enim magna ea nostrud irure elit pariatur ea dolore in. Enim magna ea nostrud irure elit pariatur ea dolore in.Enim magna ea nostrud irure elit pariatur ea dolore in.Enim magna ea nostrud irure elit pariatur ea dolore in.",
61+
description: "Enim magna ea nostrud irure elit pariatur ea dolore in. Enim magna ea nostrud irure elit pariatur ea dolore in.",
6262
dateTime: Date(timeIntervalSince1970: 1727905659),
6363
location: "Berlin",
6464
latitude: 53.1235,
@@ -83,7 +83,7 @@ struct RideEventView: View {
8383
),
8484
slug: nil,
8585
title: "CriticalMaps Berlin",
86-
description: "Enim magna ea nostrud irure elit pariatur ea dolore in. Enim magna ea nostrud irure elit pariatur ea dolore in.Enim magna ea nostrud irure elit pariatur ea dolore in.Enim magna ea nostrud irure elit pariatur ea dolore in.",
86+
description: "Enim magna ea nostrud irure elit pariatur ea dolore in. Enim magna ea nostrud irure elit pariatur ea dolore in.",
8787
dateTime: Date(timeIntervalSince1970: 1727905659),
8888
location: "Berlin",
8989
latitude: 53.1235,

CriticalMapsKit/Sources/ChatFeature/ChatFeatureCore.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ public struct ChatFeature {
118118
state.chatInputState.isSending = false
119119

120120
state.alert = AlertState(
121-
title: TextState(L10n.error),
122-
message: TextState("Failed to send chat message")
121+
title: { TextState(L10n.error) },
122+
message: { TextState("Failed to send chat message") }
123123
)
124124

125125
logger.debug("ChatInput Action failed with error: \(error.localizedDescription)")

CriticalMapsKit/Sources/FeedbackGeneratorClient/FeedbackGeneratorClient.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ extension FeedbackGeneratorClient: DependencyKey {
1313
public static let liveValue = {
1414
let generator = UISelectionFeedbackGenerator()
1515
return Self(
16-
prepare: { await generator.prepare() },
17-
selectionChanged: { await generator.selectionChanged() }
16+
prepare: { generator.prepare() },
17+
selectionChanged: { generator.selectionChanged() }
1818
)
1919
}()
2020
}

CriticalMapsKit/Sources/MapFeature/MapFeatureCore.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,10 @@ public struct MapFeature {
124124

125125
case .didChangeAuthorization(.denied):
126126
if state.isRequestingCurrentLocation {
127-
state.alert = AlertState(
128-
title: TextState("Location makes this app better. Please consider giving us access.")
129-
)
127+
state.alert = AlertState {
128+
TextState("Location makes this app better. Please consider giving us access.")
129+
}
130+
130131
state.isRequestingCurrentLocation = false
131132
}
132133
return .none
@@ -294,15 +295,17 @@ extension LocationManager {
294295

295296
public extension AlertState where Action == MapFeature.Action {
296297
static let goToSettingsAlert = Self(
297-
title: TextState(L10n.Location.Alert.provideAccessToLocationService),
298-
primaryButton: .default(TextState(L10n.Settings.title)),
299-
secondaryButton: .default(TextState(L10n.ok))
298+
title: { TextState(L10n.Location.Alert.provideAccessToLocationService) },
299+
actions: {
300+
ButtonState<MapFeature.Action> { TextState(L10n.Settings.title) }
301+
ButtonState<MapFeature.Action> { TextState(L10n.Settings.title) }
302+
}
300303
)
301304

302-
static let provideAuth = Self(title: TextState(L10n.Location.Alert.provideAuth))
303-
static let servicesOff = Self(title: TextState(L10n.Location.Alert.serviceIsOff))
305+
static let provideAuth = Self(title: {TextState(L10n.Location.Alert.provideAuth)})
306+
static let servicesOff = Self(title: {TextState(L10n.Location.Alert.serviceIsOff)})
304307
static let provideAccessToLocationService = Self(
305-
title: TextState(L10n.Location.Alert.provideAccessToLocationService)
308+
title: {TextState(L10n.Location.Alert.provideAccessToLocationService)}
306309
)
307310
}
308311

CriticalMapsKit/Sources/MapFeature/MapOverlayView.swift

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,20 @@ public struct MapOverlayView<Content>: View where Content: View {
7474
}
7575
}
7676
)
77-
.transition(.scale.animation(reduceMotion ? nil : .easeOut(duration: 0.2)))
78-
.onChange(of: viewStore.isExpanded, perform: { newValue in
79-
let updateAction: () -> Void = { self.isExpanded = newValue }
80-
reduceMotion ? updateAction() : withAnimation { updateAction() }
81-
})
82-
.onChange(of: viewStore.isVisible, perform: { newValue in
83-
let updateAction: () -> Void = { self.isVisible = newValue }
84-
reduceMotion ? updateAction() : withAnimation { updateAction() }
85-
})
77+
.transition(.scale.combined(with: .opacity).animation(reduceMotion ? nil : .spring(duration: 0.2)))
78+
.onChange(
79+
of: viewStore.isExpanded,
80+
perform: { newValue in
81+
let updateAction: () -> Void = { self.isExpanded = newValue }
82+
reduceMotion ? updateAction() : withAnimation { updateAction() }
83+
}
84+
)
85+
.onChange(
86+
of: viewStore.isVisible,
87+
perform: { newValue in
88+
let updateAction: () -> Void = { self.isVisible = newValue }
89+
reduceMotion ? updateAction() : withAnimation { updateAction() }
90+
}
91+
)
8692
}
8793
}

CriticalMapsKit/Sources/MastodonFeedFeature/MastodonFeedView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ public struct MastodonFeedView: View {
2424
public init(store: StoreOf<TootFeedFeature>) {
2525
self.store = store
2626
viewStore = ViewStore(
27-
store.scope(state: MastodonFeedViewState.init, action: { $0 }),
27+
store.scope(
28+
state: MastodonFeedViewState.init,
29+
action: { $0 }
30+
),
2831
observe: { $0 }
2932
)
3033
}

CriticalMapsKit/Sources/MastodonFeedFeature/TootFeedFeature.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public struct TootFeedFeature {
3939
case refresh
4040
case fetchData
4141
case fetchDataResponse(TaskResult<[Status]>)
42-
case toot(id: TootFeature.State.ID, action: TootFeature.Action)
42+
case toot(IdentifiedActionOf<TootFeature>)
4343
}
4444

4545

@@ -90,13 +90,13 @@ public struct TootFeedFeature {
9090
return .none
9191
}
9292
}
93-
.forEach(\.toots, action: /TootFeedFeature.Action.toot) {
93+
.forEach(\.toots, action: \.toot) {
9494
TootFeature()
9595
}
9696
}
9797
}
9898

99-
extension MastodonKit.Status: Identifiable {
99+
extension MastodonKit.Status: @retroactive Identifiable {
100100
public static func == (lhs: MastodonKit.Status, rhs: MastodonKit.Status) -> Bool {
101101
lhs.id == rhs.id
102102
}

CriticalMapsKit/Sources/MastodonFeedFeature/TootsListView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public struct TootsListView: View {
6464
ForEachStore(
6565
self.store.scope(
6666
state: \.toots,
67-
action: TootFeedFeature.Action.toot
67+
action: \.toot
6868
)
6969
) {
7070
TootView(store: $0)

CriticalMapsKit/Sources/SettingsFeature/RideEventRadius.swift

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,31 @@ public struct RideEventRadiusView: View {
4141
let store: StoreOf<RideEventRadius>
4242

4343
public var body: some View {
44-
WithViewStore(self.store, observe: { $0 }) { viewStore in
45-
SettingsRow {
46-
Button(
47-
action: { viewStore.send(.set(\.$isSelected, true)) },
48-
label: {
49-
HStack(spacing: .grid(3)) {
50-
Text(String(viewStore.eventDistance.displayValue))
51-
.accessibility(label: Text(viewStore.eventDistance.displayValue))
52-
.padding(.vertical, .grid(2))
53-
Spacer()
54-
if viewStore.isSelected {
55-
Image(systemName: "checkmark.circle.fill")
56-
.accessibilityRepresentation {
57-
Text(L10n.A11y.General.selected)
58-
}
44+
WithViewStore(
45+
self.store,
46+
observe: { $0 },
47+
content: { viewStore in
48+
SettingsRow {
49+
Button(
50+
action: { viewStore.send(.set(\.$isSelected, true)) },
51+
label: {
52+
HStack(spacing: .grid(3)) {
53+
Text(String(viewStore.eventDistance.displayValue))
54+
.accessibility(label: Text(viewStore.eventDistance.displayValue))
55+
.padding(.vertical, .grid(2))
56+
Spacer()
57+
if viewStore.isSelected {
58+
Image(systemName: "checkmark.circle.fill")
59+
.accessibilityRepresentation {
60+
Text(L10n.A11y.General.selected)
61+
}
62+
}
5963
}
64+
.accessibilityElement(children: .combine)
6065
}
61-
.accessibilityElement(children: .combine)
62-
}
63-
)
66+
)
67+
}
6468
}
65-
}
69+
)
6670
}
6771
}

0 commit comments

Comments
 (0)