mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-03-14 22:22:41 +00:00
Refactor proxy url
This commit is contained in:
parent
c8c379281f
commit
3e14a92b7d
4 changed files with 4 additions and 3 deletions
|
@ -56,7 +56,7 @@ private struct SafariRouter: ViewModifier {
|
|||
UIApplication.shared.open(url)
|
||||
return .handled
|
||||
}
|
||||
} else if url.host() == "social-proxy.com", let accountName = appAccount.currentAccount.accountName {
|
||||
} else if url.host() == AppInfo.premiumInstance, let accountName = appAccount.currentAccount.accountName {
|
||||
let newURL = url.appending(queryItems: [
|
||||
.init(name: "callback", value: "icecubesapp://socialproxy"),
|
||||
.init(name: "id", value: "@\(accountName)")
|
||||
|
|
|
@ -125,7 +125,7 @@ struct TipSheetView: View {
|
|||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
if let selectedTip,
|
||||
let accountName = appAccount.currentAccount.accountName,
|
||||
let url = URL(string: "https://social-proxy.com/subscribe/to/\(account.username)?callback=icecubesapp://socialproxy&id=@\(accountName)&amount=\(selectedTip)¤cy=USD") {
|
||||
let url = URL(string: "https://\(AppInfo.premiumInstance)/subscribe/to/\(account.username)?callback=icecubesapp://socialproxy&id=@\(accountName)&amount=\(selectedTip)¤cy=USD") {
|
||||
openURL(url)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public final class Account: Codable, Identifiable, Hashable, Sendable, Equatable
|
|||
}
|
||||
|
||||
public var isProAccount: Bool {
|
||||
url?.host() == "social-proxy.com"
|
||||
url?.host() == AppInfo.premiumInstance
|
||||
}
|
||||
|
||||
public var fullAccountName: String {
|
||||
|
|
|
@ -9,4 +9,5 @@ public enum AppInfo {
|
|||
public static let revenueCatKey = "appl_JXmiRckOzXXTsHKitQiicXCvMQi"
|
||||
public static let defaultServer = "mastodon.social"
|
||||
public static let keychainGroup = "346J38YKE3.com.thomasricouard.IceCubesApp"
|
||||
public static let premiumInstance = "social-proxy.com"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue