2023-12-29 11:17:37 +01:00
|
|
|
//Made by Lumaa
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct AccountView: View {
|
2024-01-02 14:23:36 +01:00
|
|
|
@Environment(AccountManager.self) private var accountManager: AccountManager
|
|
|
|
|
2024-01-21 13:09:50 +01:00
|
|
|
@State private var navigator: Navigator = Navigator()
|
2024-02-04 10:44:51 +01:00
|
|
|
@State public var account: Account
|
2023-12-29 11:17:37 +01:00
|
|
|
|
|
|
|
var body: some View {
|
2024-02-04 10:44:51 +01:00
|
|
|
NavigationStack(path: $navigator.path) {
|
|
|
|
ProfileView(account: account, isCurrent: true)
|
|
|
|
.withAppRouter(navigator)
|
|
|
|
.onAppear {
|
|
|
|
account = accountManager.forceAccount()
|
2023-12-31 03:03:35 +01:00
|
|
|
}
|
2024-01-02 14:23:36 +01:00
|
|
|
}
|
2024-04-04 18:46:38 +02:00
|
|
|
.environment(\.openURL, OpenURLAction { url in
|
|
|
|
// Open internal URL.
|
|
|
|
let handled = navigator.handle(url: url)
|
|
|
|
return handled
|
|
|
|
})
|
2024-03-23 11:17:27 +01:00
|
|
|
.environmentObject(navigator)
|
2024-01-02 14:23:36 +01:00
|
|
|
}
|
2023-12-29 11:17:37 +01:00
|
|
|
}
|