diff --git a/.swiftformat b/.swiftformat index bcd35a4dc..02b72a2b8 100644 --- a/.swiftformat +++ b/.swiftformat @@ -8,6 +8,7 @@ --disable consistentSwitchCaseSpacing --disable docCommentsBeforeModifiers # throwing false positives in AuthenticationServiceProtocol on v0.58.0 --disable emptyExtensions +--disable redundantStateInit # this can break some preview tests --commas inline --ifdef no-indent diff --git a/ElementX/Sources/Screens/Timeline/View/Style/TimelineStyler.swift b/ElementX/Sources/Screens/Timeline/View/Style/TimelineStyler.swift index 9e1378144..e2d16acee 100644 --- a/ElementX/Sources/Screens/Timeline/View/Style/TimelineStyler.swift +++ b/ElementX/Sources/Screens/Timeline/View/Style/TimelineStyler.swift @@ -21,7 +21,7 @@ struct TimelineStyler: View { init(timelineItem: EventBasedTimelineItemProtocol, @ViewBuilder content: @escaping () -> Content) { self.timelineItem = timelineItem self.content = content - adjustedDeliveryStatus = timelineItem.properties.deliveryStatus + _adjustedDeliveryStatus = State(initialValue: timelineItem.properties.deliveryStatus) } var body: some View { diff --git a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift index 48c4c67b6..bbf8b4c8b 100644 --- a/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift +++ b/ElementX/Sources/Screens/Timeline/View/TimelineItemViews/LiveLocationRoomTimelineView.swift @@ -18,7 +18,7 @@ struct LiveLocationRoomTimelineView: View { init(currentDate: Date = .now, timelineItem: LiveLocationRoomTimelineItem, isStopped: Bool = false) { self.currentDate = currentDate 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.