settings page + re-view tutorial

This commit is contained in:
leminlimez committed 2025-06-01 06:43:29 -04:00
1 parent 5e8b061d10
commit 3d2cd8d522
2 files changed
+66 -22

No files matched your search

+26 -22
View File
@@ -36,15 +36,6 @@ struct ContentView: View {
}
.font(.caption)
.padding(.bottom, 10)
Section {
HStack {
Text("App Hash:")
.bold()
Spacer()
}
TextField("App Hash", text: $pbHash)
}
.padding(.bottom, 5)
Section {
Button(action: {
@@ -70,26 +61,39 @@ struct ContentView: View {
}
Section {
if selectedTendies != nil && pbHash != "" {
Button(action: {
do {
try PosterBoardManager.applyTendies(selectedTendies!, appHash: pbHash)
selectedTendies = nil
lastError = "The PosterBoard app will now open. Please close it from the app switcher."
showSuccessAlert.toggle()
} catch {
lastError = error.localizedDescription
showErrorAlert.toggle()
if selectedTendies != nil {
if pbHash == "" {
Text("Enter your PosterBoard app hash in Settings.")
} else {
Button(action: {
do {
try PosterBoardManager.applyTendies(selectedTendies!, appHash: pbHash)
selectedTendies = nil
lastError = "The PosterBoard app will now open. Please close it from the app switcher."
showSuccessAlert.toggle()
} catch {
lastError = error.localizedDescription
showErrorAlert.toggle()
}
}) {
Text("Apply")
}
}) {
Text("Apply")
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
}
.buttonStyle(TintedButton(color: .blue, fullwidth: true))
}
}
}
.padding()
.navigationTitle("Pocket Poster")
.toolbar {
ToolbarItem(placement: .topBarTrailing, content: {
NavigationLink(destination: {
SettingsView()
}, label: {
Image(systemName: "gear")
})
})
}
}
.fileImporter(isPresented: $showTendiesImporter, allowedContentTypes: [UTType(filenameExtension: "tendies", conformingTo: .data)!], allowsMultipleSelection: true, onCompletion: { result in
switch result {