Bubble/Threaded/Views/AccountView.swift

27 lines
766 B
Swift
Raw Normal View History

2023-12-29 11:17:37 +01:00
//Made by Lumaa
import SwiftUI
struct AccountView: View {
@Environment(AccountManager.self) private var accountManager: AccountManager
2024-01-21 13:09:50 +01:00
@State private var navigator: Navigator = Navigator()
@State public var account: Account
2023-12-29 11:17:37 +01:00
var body: some View {
NavigationStack(path: $navigator.path) {
ProfileView(account: account, isCurrent: true)
.withAppRouter(navigator)
.onAppear {
account = accountManager.forceAccount()
2023-12-31 03:03:35 +01: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)
}
2023-12-29 11:17:37 +01:00
}