Remove redundant function
contributes to iOS-319
This commit is contained in:
parent
40ec6e94b2
commit
8ee189e3cf
@ -653,7 +653,7 @@ extension ProfileViewController {
|
|||||||
viewModel.profileAboutViewModel.fields = updatedAccount.mastodonFields
|
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
|
viewModel.me = updatedMe
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1096,7 +1096,7 @@ extension ProfileViewController {
|
|||||||
} else if viewModel.account == viewModel.me {
|
} else if viewModel.account == viewModel.me {
|
||||||
// update my profile
|
// update my profile
|
||||||
Task {
|
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.me = updatedMe
|
||||||
viewModel.account = updatedMe
|
viewModel.account = updatedMe
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ extension MainTabBarController {
|
|||||||
guard let authenticationBox else { return }
|
guard let authenticationBox else { return }
|
||||||
|
|
||||||
Task { @MainActor in
|
Task { @MainActor in
|
||||||
let profileResponse = try await APIService.shared.authenticatedUserInfo(authenticationBox: authenticationBox)
|
let profileResponse = try await APIService.shared.accountInfo(authenticationBox)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,13 +12,6 @@ import MastodonCommon
|
|||||||
import MastodonSDK
|
import MastodonSDK
|
||||||
|
|
||||||
extension APIService {
|
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
|
public func accountInfo(_ authenticationBox: MastodonAuthenticationBox
|
||||||
) async throws -> Mastodon.Entity.Account {
|
) async throws -> Mastodon.Entity.Account {
|
||||||
let account = try await Mastodon.API.Account.accountInfo(
|
let account = try await Mastodon.API.Account.accountInfo(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user