32 lines
870 B
Swift
32 lines
870 B
Swift
//
|
|
// JelApp.swift
|
|
// Jel
|
|
//
|
|
// Created by zerocool on 12/11/23.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct JelApp: App {
|
|
let jellyfinClientController = JellyfinClientController(authHeaders: AuthHeaders(
|
|
Client: "Jel",
|
|
Device: UIDevice.current.systemName,
|
|
DeviceId: UIDevice.current.identifierForVendor!.uuidString,
|
|
Version: Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0",
|
|
Token: ""))
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
ContentView()
|
|
.environmentObject(jellyfinClientController)
|
|
.task {
|
|
AuthStateController.shared.load()
|
|
SettingsController.shared.load()
|
|
jellyfinClientController.setUrl(url: AuthStateController.shared.serverUrl)
|
|
jellyfinClientController.setToken(token: AuthStateController.shared.authToken ?? "")
|
|
}
|
|
}
|
|
}
|
|
}
|