DEBUG: explore link changing
This commit is contained in:
1 parent
9687a8f19d
commit
5a94ea73d9
4 files changed
+37
-3
No files matched your search
@@ -10,6 +10,7 @@ import UIKit
|
||||
|
||||
class DownloadManager: ObservableObject {
|
||||
static let shared = DownloadManager()
|
||||
static let exploreLink = "https://cowabun.ga/wallpapers?pocketposter=true"
|
||||
|
||||
@Published var downloadURL: String? = nil
|
||||
|
||||
|
||||
@@ -11,8 +11,17 @@ struct ExploreView: View {
|
||||
@State private var isLoading = true
|
||||
@State private var error: Error? = nil
|
||||
|
||||
#if DEBUG
|
||||
@AppStorage("exploreLink") var exploreLink: String = DownloadManager.exploreLink
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
#if DEBUG
|
||||
let websiteURL = URL(string: exploreLink)
|
||||
#else
|
||||
let websiteURL = URL(string: DownloadManager.exploreLink)
|
||||
#endif
|
||||
if let error = error {
|
||||
VStack {
|
||||
Text(error.localizedDescription)
|
||||
@@ -24,7 +33,7 @@ struct ExploreView: View {
|
||||
Text("Retry")
|
||||
}
|
||||
}
|
||||
} else if let url = URL(string: "https://cowabun.ga/wallpapers?pocketposter=true") {
|
||||
} else if let url = websiteURL {
|
||||
WallpaperWebView(url, isLoading: $isLoading, error: $error)
|
||||
if isLoading {
|
||||
ProgressView()
|
||||
|
||||
@@ -13,6 +13,11 @@ struct SettingsView: View {
|
||||
@AppStorage("cpHash") var cpHash: String = "" // CarPlay hash
|
||||
@AppStorage("ignoreDurationLimit") var ignoreDurationLimit: Bool = false
|
||||
|
||||
// DEBUG
|
||||
#if DEBUG
|
||||
@AppStorage("exploreLink") var exploreLink: String = DownloadManager.exploreLink
|
||||
#endif
|
||||
|
||||
@State var checkingForHash: Bool = false
|
||||
@State var hashCheckTask: Task<Void, any Error>? = nil
|
||||
|
||||
@@ -53,6 +58,19 @@ struct SettingsView: View {
|
||||
Label("App Hash", systemImage: "lock.app.dashed")
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
Section {
|
||||
VStack {
|
||||
Text(String("Explore Page URL"))
|
||||
TextField(String("Enter Explore Page URL"), text: $exploreLink)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
.font(.system(.body, design: .monospaced))
|
||||
}
|
||||
} header: {
|
||||
Label(String("Debug"), systemImage: "ant")
|
||||
}
|
||||
#endif
|
||||
|
||||
Section {
|
||||
Toggle(isOn: $ignoreDurationLimit, label: {
|
||||
Label("Disable Video Duration Limit", systemImage: "ruler")
|
||||
|
||||
Reference in new issue
Block a user