Fix the presentation of QuickLook when viewing logs on macOS. (#3556)

This commit is contained in:
Doug 2024-11-26 14:23:20 +00:00 committed by GitHub
parent fe984a1301
commit 3f0f442937
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 7 deletions

View File

@ -6,6 +6,7 @@
//
import Combine
import Foundation
struct BugReportFlowCoordinatorParameters {
enum PresentationMode {
@ -93,13 +94,23 @@ class BugReportFlowCoordinator: FlowCoordinatorProtocol {
switch action {
case .done:
if ProcessInfo.processInfo.isiOSAppOnMac {
internalNavigationStackCoordinator?.setSheetCoordinator(nil)
} else {
internalNavigationStackCoordinator?.pop()
}
}
}
.store(in: &cancellables)
if ProcessInfo.processInfo.isiOSAppOnMac {
// On macOS the QuickLook is a separate window, closing a pushed QuickLook
// controller closes the whole Settings sheet so lets add another one.
internalNavigationStackCoordinator?.setSheetCoordinator(coordinator)
} else {
internalNavigationStackCoordinator?.push(coordinator)
}
}
private func dismiss() {
switch parameters.presentationMode {

View File

@ -25,12 +25,8 @@ private struct PreviewView: UIViewControllerRepresentable {
previewController.dataSource = context.coordinator
previewController.delegate = context.coordinator
if ProcessInfo.processInfo.isiOSAppOnMac {
return previewController
} else {
return UINavigationController(rootViewController: previewController)
}
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) { }