Remove redundant function

contributes to iOS-319
This commit is contained in:
shannon 2024-11-18 11:45:37 -05:00
parent 40ec6e94b2
commit 8ee189e3cf
3 changed files with 3 additions and 10 deletions

View File

@ -653,7 +653,7 @@ extension ProfileViewController {
viewModel.profileAboutViewModel.fields = updatedAccount.mastodonFields
}
if let updatedMe = try? await APIService.shared.authenticatedUserInfo(authenticationBox: viewModel.authenticationBox) {
if let updatedMe = try? await APIService.shared.accountInfo(viewModel.authenticationBox) {
viewModel.me = updatedMe
}
@ -1096,7 +1096,7 @@ extension ProfileViewController {
} else if viewModel.account == viewModel.me {
// update my profile
Task {
if let updatedMe = try? await APIService.shared.authenticatedUserInfo(authenticationBox: viewModel.authenticationBox) {
if let updatedMe = try? await APIService.shared.accountInfo(viewModel.authenticationBox) {
viewModel.me = updatedMe
viewModel.account = updatedMe
}

View File

@ -380,7 +380,7 @@ extension MainTabBarController {
guard let authenticationBox else { return }
Task { @MainActor in
let profileResponse = try await APIService.shared.authenticatedUserInfo(authenticationBox: authenticationBox)
let profileResponse = try await APIService.shared.accountInfo(authenticationBox)
}
}
}

View File

@ -12,13 +12,6 @@ import MastodonCommon
import MastodonSDK
extension APIService {
public func authenticatedUserInfo(
authenticationBox: MastodonAuthenticationBox
) async throws -> Mastodon.Entity.Account {
let authenticated = try await accountInfo(authenticationBox)
return authenticated
}
public func accountInfo(_ authenticationBox: MastodonAuthenticationBox
) async throws -> Mastodon.Entity.Account {
let account = try await Mastodon.API.Account.accountInfo(