From 8ee189e3cfa849db36772f165d2a6640412be77d Mon Sep 17 00:00:00 2001 From: shannon Date: Mon, 18 Nov 2024 11:45:37 -0500 Subject: [PATCH] Remove redundant function contributes to iOS-319 --- Mastodon/Scene/Profile/ProfileViewController.swift | 4 ++-- Mastodon/Scene/Root/MainTab/MainTabBarController.swift | 2 +- .../MastodonCore/Service/API/APIService+Account.swift | 7 ------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Mastodon/Scene/Profile/ProfileViewController.swift b/Mastodon/Scene/Profile/ProfileViewController.swift index cd805cbac..8fb31bb21 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -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 } diff --git a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift index c094d1e9e..bbeb67441 100644 --- a/Mastodon/Scene/Root/MainTab/MainTabBarController.swift +++ b/Mastodon/Scene/Root/MainTab/MainTabBarController.swift @@ -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) } } } diff --git a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift index 651b1a37f..8d671f000 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/API/APIService+Account.swift @@ -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(