mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Minor quicklook fixes. (#6112)
* Only show a spinner when opening the media viewer is slow * Keep a sent local echo's page in the media viewer * Fix the caption visibility. --------- Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com> Co-authored-by: Matthew Hodgson <matthew@matrix.org>
This commit is contained in:
@@ -708,8 +708,15 @@ class TimelineViewModel: TimelineViewModelType, TimelineViewModelProtocol {
|
||||
}
|
||||
|
||||
private func handleMediaTapped(with itemID: TimelineItemIdentifier, galleryIndex: Int? = nil) async {
|
||||
state.showLoading = true
|
||||
// Building the media timeline takes ~100ms from the event cache, however its possible that
|
||||
// a focussed timeline may hit /context so we need to show a spinner when it's actually slow.
|
||||
let spinner = Task {
|
||||
try? await Task.sleep(for: .milliseconds(300))
|
||||
guard !Task.isCancelled else { return }
|
||||
state.showLoading = true
|
||||
}
|
||||
let action = await timelineInteractionHandler.processItemTap(itemID)
|
||||
spinner.cancel()
|
||||
|
||||
switch action {
|
||||
case .displayMediaPreview(let item, let timelineViewModelKind):
|
||||
|
||||
Reference in New Issue
Block a user