Remove duplicate code (IOS-140)
This commit is contained in:
parent
93533654f8
commit
dbf6e6b467
|
@ -44,3 +44,15 @@ extension DataSourceFacade {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension UserTableViewCellDelegate where Self: NeedsDependency & AuthContextProvider {
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,14 +93,4 @@ extension FamiliarFollowersViewController: UITableViewDelegate, AutoGenerateTabl
|
|||
}
|
||||
|
||||
// MARK: - UserTableViewCellDelegate
|
||||
extension FamiliarFollowersViewController: UserTableViewCellDelegate {
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
extension FamiliarFollowersViewController: UserTableViewCellDelegate {}
|
||||
|
|
|
@ -119,14 +119,4 @@ extension FollowerListViewController: UITableViewDelegate, AutoGenerateTableView
|
|||
}
|
||||
|
||||
// MARK: - UserTableViewCellDelegate
|
||||
extension FollowerListViewController: UserTableViewCellDelegate {
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
extension FollowerListViewController: UserTableViewCellDelegate {}
|
||||
|
|
|
@ -117,14 +117,4 @@ extension FollowingListViewController: UITableViewDelegate, AutoGenerateTableVie
|
|||
}
|
||||
|
||||
// MARK: - UserTableViewCellDelegate
|
||||
extension FollowingListViewController: UserTableViewCellDelegate {
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
extension FollowingListViewController: UserTableViewCellDelegate {}
|
||||
|
|
|
@ -109,14 +109,4 @@ extension FavoritedByViewController: UITableViewDelegate, AutoGenerateTableViewD
|
|||
}
|
||||
|
||||
// MARK: - UserTableViewCellDelegate
|
||||
extension FavoritedByViewController: UserTableViewCellDelegate {
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
extension FavoritedByViewController: UserTableViewCellDelegate {}
|
||||
|
|
|
@ -109,14 +109,4 @@ extension RebloggedByViewController: UITableViewDelegate, AutoGenerateTableViewD
|
|||
}
|
||||
|
||||
// MARK: - UserTableViewCellDelegate
|
||||
extension RebloggedByViewController: UserTableViewCellDelegate {
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
extension RebloggedByViewController: UserTableViewCellDelegate {}
|
||||
|
|
|
@ -124,14 +124,6 @@ extension SearchHistoryViewController: SearchHistorySectionHeaderCollectionReusa
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension SearchHistoryViewController: UserTableViewCellDelegate {}
|
||||
|
|
|
@ -259,14 +259,4 @@ extension SearchResultViewController: UITableViewDelegate, AutoGenerateTableView
|
|||
extension SearchResultViewController: StatusTableViewCellDelegate { }
|
||||
|
||||
// MARK: - UserTableViewCellDelegate
|
||||
extension SearchResultViewController: UserTableViewCellDelegate {
|
||||
func userView(_ view: UserView, didTapButtonWith state: UserView.ButtonState, for user: MastodonUser) {
|
||||
Task {
|
||||
try await DataSourceFacade.responseToUserViewButtonAction(
|
||||
dependency: self,
|
||||
user: user.asRecord,
|
||||
buttonState: state
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
extension SearchResultViewController: UserTableViewCellDelegate {}
|
||||
|
|
Loading…
Reference in New Issue