This commit is contained in:
Thomas Ricouard 2024-01-09 19:06:54 +01:00
parent 5c1f113c54
commit 8ea3fa73e5
3 changed files with 14 additions and 12 deletions

View file

@ -47,15 +47,17 @@ private struct SafariRouter: ViewModifier {
}
#if !targetEnvironment(macCatalyst)
guard preferences.preferredBrowser == .inAppSafari else { return .systemAction }
#endif
// SFSafariViewController only supports initial URLs with http:// or https:// schemes.
guard let scheme = url.scheme, ["https", "http"].contains(scheme.lowercased()) else {
// SFSafariViewController only supports initial URLs with http:// or https:// schemes.
guard let scheme = url.scheme, ["https", "http"].contains(scheme.lowercased()) else {
return .systemAction
}
#if os(visionOS)
return .systemAction
}
#if os(visionOS)
return .systemAction
#else
return safariManager.open(url)
#endif
#else
return safariManager.open(url)
return .systemAction
#endif
}
}

View file

@ -75,9 +75,7 @@ private struct MediaToolBar: ToolbarContent {
let data: DisplayData
var body: some ToolbarContent {
#if !targetEnvironment(macCatalyst)
DismissToolbarItem()
#endif
DismissToolbarItem()
QuickLookToolbarItem(itemUrl: data.url)
AltTextToolbarItem(alt: data.description)
SavePhotoToolbarItem(url: data.url, type: data.type)
@ -95,6 +93,8 @@ private struct DismissToolbarItem: ToolbarContent {
} label: {
Image(systemName: "xmark.circle")
}
.opacity(0)
.keyboardShortcut(.cancelAction)
}
}
}

View file

@ -228,12 +228,12 @@ extension StatusEditor {
postingTimer = nil
if let postStatus {
StreamWatcher.shared.emmitEditEvent(for: postStatus)
HapticManager.shared.fireHaptic(.notification(.success))
withAnimation {
postingProgress = 99.0
}
try await Task.sleep(for: .seconds(0.5))
StreamWatcher.shared.emmitEditEvent(for: postStatus)
HapticManager.shared.fireHaptic(.notification(.success))
}
if hasExplicitlySelectedLanguage, let selectedLanguage {