fix preview tests broken by a swiftformat rule,

This commit is contained in:
Mauro Romito
2026-06-08 13:15:04 +02:00
committed by Mauro
parent 6ec1f0eb10
commit d22caf1a13
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -8,6 +8,7 @@
--disable consistentSwitchCaseSpacing --disable consistentSwitchCaseSpacing
--disable docCommentsBeforeModifiers # throwing false positives in AuthenticationServiceProtocol on v0.58.0 --disable docCommentsBeforeModifiers # throwing false positives in AuthenticationServiceProtocol on v0.58.0
--disable emptyExtensions --disable emptyExtensions
--disable redundantStateInit # this can break some preview tests
--commas inline --commas inline
--ifdef no-indent --ifdef no-indent
@@ -21,7 +21,7 @@ struct TimelineStyler<Content: View>: View {
init(timelineItem: EventBasedTimelineItemProtocol, @ViewBuilder content: @escaping () -> Content) { init(timelineItem: EventBasedTimelineItemProtocol, @ViewBuilder content: @escaping () -> Content) {
self.timelineItem = timelineItem self.timelineItem = timelineItem
self.content = content self.content = content
adjustedDeliveryStatus = timelineItem.properties.deliveryStatus _adjustedDeliveryStatus = State(initialValue: timelineItem.properties.deliveryStatus)
} }
var body: some View { var body: some View {
@@ -18,7 +18,7 @@ struct LiveLocationRoomTimelineView: View {
init(currentDate: Date = .now, timelineItem: LiveLocationRoomTimelineItem, isStopped: Bool = false) { init(currentDate: Date = .now, timelineItem: LiveLocationRoomTimelineItem, isStopped: Bool = false) {
self.currentDate = currentDate self.currentDate = currentDate
self.timelineItem = timelineItem self.timelineItem = timelineItem
hasExpired = isStopped || currentDate >= timelineItem.content.timeoutDate _hasExpired = State(initialValue: isStopped || currentDate >= timelineItem.content.timeoutDate)
} }
/// A publisher that fires once when the timeoutDate is reached, setting `hasExpired` to true. /// A publisher that fires once when the timeoutDate is reached, setting `hasExpired` to true.