Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 2fdefcd

Browse files
authored
Refactor SetupView for shortcut URL handling
Updated the shortcut URL handling to use a proper URL scheme for importing shortcuts.
1 parent a2f7674 commit 2fdefcd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Sources/prostore/views/SetupView.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ struct SetupView: View {
6969

7070
Button(currentPage == pages.count - 1 ? "Finish" : "Next") {
7171
withAnimation {
72-
if pages[currentPage].title == "Install ProStore Shortcut",
73-
let shortcutURL = URL(string: "https://raw.githubusercontent.com/ProStore-iOS/files/refs/heads/main/Turn%20on%20VPN.shortcut") {
74-
UIApplication.shared.open(shortcutURL)
75-
}
72+
if pages[currentPage].title == "Install ProStore Shortcut",
73+
let rawURL = "https://raw.githubusercontent.com/ProStore-iOS/files/refs/heads/main/Turn%20on%20VPN.shortcut".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed),
74+
let shortcutURL = URL(string: "shortcuts://import-shortcut?url=\(rawURL)") {
75+
UIApplication.shared.open(shortcutURL)
76+
}
7677

7778
if currentPage < pages.count - 1 {
7879
currentPage += 1
@@ -96,4 +97,5 @@ struct SetupPage {
9697
let title: String
9798
let subtitle: String
9899
let imageName: String
99-
}
100+
101+
}

0 commit comments

Comments
 (0)