Add server URL to settings

This commit is contained in:
Shav Kinderlehrer 2024-01-08 08:26:46 -05:00
parent 1f25fa576d
commit ca47292e3d
3 changed files with 9 additions and 4 deletions

View File

@ -21,7 +21,6 @@ struct JelApp: App {
ContentView()
.environmentObject(jellyfinClientController)
.task {
URLCache.shared.diskCapacity = 1_000_000_000 // 1GB cache for images
AuthStateController.shared.load()
SettingsController.shared.load()
jellyfinClientController.setUrl(url: AuthStateController.shared.serverUrl)

View File

@ -47,6 +47,7 @@ struct ItemMediaView<Content: View>: View {
}
ItemGenresView(item: item)
.padding(.vertical)
}
.if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) > 0) {view in
view

View File

@ -28,6 +28,11 @@ struct SettingsView: View {
.textSelection(.enabled)
}
LabeledContent("Server URL") {
Text("\(authState.serverUrl?.absoluteString ?? "---")")
.textSelection(.enabled)
}
Button(role: .destructive) {
authState.loggedIn = false
authState.save()
@ -81,6 +86,6 @@ struct SettingsView: View {
}
}
#Preview {
SettingsView(showingSettingsView: .constant(true))
}
//#Preview {
// SettingsView(showingSettingsView: .constant(true))
//}