mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Fixes #2058 - Prevent QuickLook from breaking media uploading on Mac, replace the preview with a plain filename label
This commit is contained in:
parent
0e6e8a5892
commit
2e1b4cb80b
@ -25,9 +25,7 @@ struct MediaUploadPreviewScreen: View {
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
PreviewView(context: context,
|
||||
fileURL: context.viewState.url,
|
||||
title: context.viewState.title)
|
||||
mainContent
|
||||
.id(UUID())
|
||||
.navigationTitle(title)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
@ -37,6 +35,19 @@ struct MediaUploadPreviewScreen: View {
|
||||
.interactiveDismissDisabled()
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var mainContent: some View {
|
||||
if ProcessInfo.processInfo.isiOSAppOnMac {
|
||||
Text(title)
|
||||
.font(.compound.headingMD)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
} else {
|
||||
PreviewView(context: context,
|
||||
fileURL: context.viewState.url,
|
||||
title: context.viewState.title)
|
||||
}
|
||||
}
|
||||
|
||||
@ToolbarContentBuilder
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
@ -117,10 +128,12 @@ struct MediaUploadPreviewScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = MediaUploadPreviewScreenViewModel(userIndicatorController: UserIndicatorControllerMock.default,
|
||||
roomProxy: RoomProxyMock(),
|
||||
mediaUploadingPreprocessor: MediaUploadingPreprocessor(),
|
||||
title: nil,
|
||||
title: "some random file name",
|
||||
url: URL.picturesDirectory)
|
||||
static var previews: some View {
|
||||
MediaUploadPreviewScreen(context: viewModel.context)
|
||||
NavigationStack {
|
||||
MediaUploadPreviewScreen(context: viewModel.context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
1
changelog.d/2058.bugfix
Normal file
1
changelog.d/2058.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Prevent QuickLook from breaking media uploading on Mac, replace the preview with a plain filename label
|
Loading…
x
Reference in New Issue
Block a user