mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-01-10 21:54:10 +01:00
MediaViewer: Add loading state for quicklook
This commit is contained in:
parent
cd0e9c10ac
commit
bbce55e703
@ -15,6 +15,7 @@ public struct MediaUIView: View, @unchecked Sendable {
|
|||||||
@State private var altTextDisplayed: String?
|
@State private var altTextDisplayed: String?
|
||||||
@State private var isAltAlertDisplayed: Bool = false
|
@State private var isAltAlertDisplayed: Bool = false
|
||||||
@State private var quickLookURL: URL?
|
@State private var quickLookURL: URL?
|
||||||
|
@State private var isLoadingQuickLook = false
|
||||||
|
|
||||||
@State private var isSavingPhoto: Bool = false
|
@State private var isSavingPhoto: Bool = false
|
||||||
@State private var didSavePhoto: Bool = false
|
@State private var didSavePhoto: Bool = false
|
||||||
@ -84,10 +85,16 @@ public struct MediaUIView: View, @unchecked Sendable {
|
|||||||
if let url = attachments.first(where: { $0.id == scrollToId})?.url {
|
if let url = attachments.first(where: { $0.id == scrollToId})?.url {
|
||||||
Button {
|
Button {
|
||||||
Task {
|
Task {
|
||||||
|
isLoadingQuickLook = true
|
||||||
quickLookURL = await localPathFor(url: url)
|
quickLookURL = await localPathFor(url: url)
|
||||||
|
isLoadingQuickLook = false
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
Image(systemName: "info.circle")
|
if isLoadingQuickLook {
|
||||||
|
ProgressView()
|
||||||
|
} else {
|
||||||
|
Image(systemName: "info.circle")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user