mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix permalink crash. (#2777)
This commit is contained in:
@@ -190,10 +190,8 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
case .focusLive:
|
case .focusLive:
|
||||||
focusLive()
|
focusLive()
|
||||||
case .scrolledToFocussedItem:
|
case .scrolledToFocussedItem:
|
||||||
Task { // Use a Task to mutate view state after the current view update.
|
// Use a Task to mutate view state after the current view update.
|
||||||
state.timelineViewState.focussedEvent?.appearance = .hasAppeared
|
Task { didScrollToFocussedItem() }
|
||||||
hideFocusLoadingIndicator()
|
|
||||||
}
|
|
||||||
case .hasSwitchedTimeline:
|
case .hasSwitchedTimeline:
|
||||||
Task { state.timelineViewState.isSwitchingTimelines = false }
|
Task { state.timelineViewState.isSwitchingTimelines = false }
|
||||||
}
|
}
|
||||||
@@ -258,6 +256,14 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
|||||||
timelineController.focusLive()
|
timelineController.focusLive()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func didScrollToFocussedItem() {
|
||||||
|
if var focussedEvent = state.timelineViewState.focussedEvent {
|
||||||
|
focussedEvent.appearance = .hasAppeared
|
||||||
|
state.timelineViewState.focussedEvent = focussedEvent
|
||||||
|
hideFocusLoadingIndicator()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func attach(_ attachment: ComposerAttachmentType) {
|
private func attach(_ attachment: ComposerAttachmentType) {
|
||||||
switch attachment {
|
switch attachment {
|
||||||
case .camera:
|
case .camera:
|
||||||
|
|||||||
Reference in New Issue
Block a user