Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit

Permalink
External schemes do not fire a sheet on ITP
Browse files Browse the repository at this point in the history
  • Loading branch information
afterxleep committed Feb 16, 2024
1 parent 72fdf7f commit 4651afe
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ final class SubscriptionITPViewModel: ObservableObject {
static let navigationBarHideThreshold = 60.0
static let downloadableContent = ["application/pdf"]
static let blankURL = "about:blank"
static let externalSchemes = ["tel", "sms", "facetime"]
}

// State variables
Expand Down Expand Up @@ -123,8 +124,9 @@ final class SubscriptionITPViewModel: ObservableObject {
self.isDownloadableContent = false
self.currentURL = url
} else {
// Fire up navigation in a separate View
if url.absoluteString != Constants.blankURL {
// Fire up navigation in a separate View (if a valid link)
if url.absoluteString != Constants.blankURL &&
!Constants.externalSchemes.contains(url.scheme ?? "") {
self.shouldNavigateToExternalURL = url
}
}
Expand Down

0 comments on commit 4651afe

Please sign in to comment.