Load admin-account (IOS-20)
This commit is contained in:
parent
cebbe04741
commit
622df06d4a
|
@ -207,13 +207,16 @@ extension SettingsCoordinator: ServerDetailsViewControllerDelegate {
|
||||||
|
|
||||||
extension SettingsCoordinator: AboutInstanceViewControllerDelegate {
|
extension SettingsCoordinator: AboutInstanceViewControllerDelegate {
|
||||||
@MainActor func showAdminAccount(_ viewController: AboutInstanceViewController, account: Mastodon.Entity.Account) {
|
@MainActor func showAdminAccount(_ viewController: AboutInstanceViewController, account: Mastodon.Entity.Account) {
|
||||||
|
Task {
|
||||||
|
let user = try await appContext.apiService.fetchUser(username: account.username, domain: authContext.mastodonAuthenticationBox.domain, authenticationBox: authContext.mastodonAuthenticationBox)
|
||||||
|
|
||||||
//TODO: Get CoreData-profile from account
|
let profileViewModel = ProfileViewModel(context: appContext, authContext: authContext, optionalMastodonUser: user)
|
||||||
|
|
||||||
let profileViewModel = ProfileViewModel(context: appContext, authContext: authContext, optionalMastodonUser: nil)
|
|
||||||
|
|
||||||
|
_ = await MainActor.run {
|
||||||
sceneCoordinator.present(scene: .profile(viewModel: profileViewModel), transition: .show)
|
sceneCoordinator.present(scene: .profile(viewModel: profileViewModel), transition: .show)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func sendEmailToAdmin(_ viewController: AboutInstanceViewController, emailAddress: String) {
|
func sendEmailToAdmin(_ viewController: AboutInstanceViewController, emailAddress: String) {
|
||||||
if let emailUrl = URL(string: "mailto:\(emailAddress)"), UIApplication.shared.canOpenURL(emailUrl) {
|
if let emailUrl = URL(string: "mailto:\(emailAddress)"), UIApplication.shared.canOpenURL(emailUrl) {
|
||||||
|
|
Loading…
Reference in New Issue