mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Stop storing the openURL action to fix a retain cycle.
Uses the existing timeline action instead.
This commit is contained in:
@@ -70,16 +70,11 @@ struct TimelineView: View {
|
||||
/// A table view wrapper that displays the timeline of a room.
|
||||
struct TimelineViewRepresentable: UIViewControllerRepresentable {
|
||||
@EnvironmentObject private var viewModelContext: TimelineViewModel.Context
|
||||
@Environment(\.openURL) var openURL
|
||||
|
||||
func makeUIViewController(context: Context) -> TimelineTableViewController {
|
||||
let tableViewController = TimelineTableViewController(coordinator: context.coordinator,
|
||||
isScrolledToBottom: $viewModelContext.isScrolledToBottom,
|
||||
scrollToBottomPublisher: viewModelContext.viewState.timelineState.scrollToBottomPublisher)
|
||||
// Needs to be dispatched on main asynchronously otherwise we get a runtime warning
|
||||
DispatchQueue.main.async {
|
||||
viewModelContext.send(viewAction: .setOpenURLAction(openURL))
|
||||
}
|
||||
return tableViewController
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user