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

View file

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

View file

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