blob: 234c1300b74135dc70b087ed1073374651fa940e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
//
// 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: ""))
@StateObject var size: ScreenSize = ScreenSize()
var body: some Scene {
WindowGroup {
GeometryReader {geo in
ContentView()
.environmentObject(jellyfinClientController)
.environmentObject(size)
.onChange(of: geo.size) {
size.size = geo.size
}
.onAppear {
size.size = geo.size
}
.task {
AuthStateController.shared.load()
SettingsController.shared.load()
jellyfinClientController.setUrl(url: AuthStateController.shared.serverUrl)
jellyfinClientController.setToken(token: AuthStateController.shared.authToken ?? "")
}
}
}
}
}
|