2
2
mirror of https://github.com/mastodon/mastodon-ios synced 2025-04-11 22:58:02 +02:00

Rename a few things here and there (IOS-235)

This commit is contained in:
Nathan Mattes 2024-04-04 13:28:07 +02:00
parent 26f3b5a7ce
commit 3fe855273b
6 changed files with 15 additions and 15 deletions

View File

@ -106,7 +106,7 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media
let showFollowingAction = UIAction(title: L10n.Scene.HomeTimeline.TimelineMenu.following, image: .init(systemName: "house")) { [weak self] _ in
guard let self, let viewModel = self.viewModel else { return }
viewModel.timelineContext = .following
viewModel.timelineContext = .home
viewModel.dataController.records = []
viewModel.loadLatestStateMachine.enter(HomeTimelineViewModel.LoadLatestState.ContextSwitch.self)
@ -123,7 +123,7 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media
let showLocalTimelineAction = UIAction(title: L10n.Scene.HomeTimeline.TimelineMenu.localCommunity, image: .init(systemName: "building.2")) { [weak self] action in
guard let self, let viewModel = self.viewModel else { return }
viewModel.timelineContext = .localCommunity
viewModel.timelineContext = .public
viewModel.loadLatestStateMachine.enter(HomeTimelineViewModel.LoadLatestState.ContextSwitch.self)
timelineSelectorButton.setAttributedTitle(
.init(string: L10n.Scene.HomeTimeline.TimelineMenu.localCommunity, attributes: [
@ -136,10 +136,10 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media
if let viewModel {
switch viewModel.timelineContext {
case .localCommunity:
case .public:
showLocalTimelineAction.state = .on
showFollowingAction.state = .off
case .following:
case .home:
showLocalTimelineAction.state = .off
showFollowingAction.state = .on
}

View File

@ -117,11 +117,11 @@ extension HomeTimelineViewModel.LoadLatestState {
let response: Mastodon.Response.Content<[Mastodon.Entity.Status]>
switch viewModel.timelineContext {
case .following:
case .home:
response = try await viewModel.context.apiService.homeTimeline(
authenticationBox: viewModel.authContext.mastodonAuthenticationBox
)
case .localCommunity:
case .public:
response = try await viewModel.context.apiService.publicTimeline(
query: .init(local: true),
authenticationBox: viewModel.authContext.mastodonAuthenticationBox

View File

@ -64,12 +64,12 @@ extension HomeTimelineViewModel.LoadOldestState {
let response: Mastodon.Response.Content<[Mastodon.Entity.Status]>
switch viewModel.timelineContext {
case .following:
case .home:
response = try await viewModel.context.apiService.homeTimeline(
maxID: maxID,
authenticationBox: viewModel.authContext.mastodonAuthenticationBox
)
case .localCommunity:
case .public:
response = try await viewModel.context.apiService.publicTimeline(
query: .init(local: true, maxID: maxID),
authenticationBox: viewModel.authContext.mastodonAuthenticationBox

View File

@ -34,7 +34,7 @@ final class HomeTimelineViewModel: NSObject {
@Published var scrollPositionRecord: ScrollPositionRecord? = nil
@Published var displaySettingBarButtonItem = true
@Published var hasPendingStatusEditReload = false
var timelineContext: MastodonFeed.Kind.HomeTimeline = .following
var timelineContext: MastodonFeed.Kind.TimelineContext = .home
weak var tableView: UITableView?
weak var timelineMiddleLoaderTableViewCellDelegate: TimelineMiddleLoaderTableViewCellDelegate?

View File

@ -172,12 +172,12 @@ private extension FeedDataController {
let response: Mastodon.Response.Content<[Mastodon.Entity.Status]>
switch timeline {
case .following:
case .home:
response = try await context.apiService.homeTimeline(
maxID: maxID,
authenticationBox: authContext.mastodonAuthenticationBox
)
case .localCommunity:
case .public:
response = try await context.apiService.publicTimeline(
query: .init(local: true, maxID: maxID),
authenticationBox: authContext.mastodonAuthenticationBox

View File

@ -7,13 +7,13 @@ public final class MastodonFeed {
public enum Kind {
case home(timeline: HomeTimeline)
case home(timeline: TimelineContext)
case notificationAll
case notificationMentions
public enum HomeTimeline {
case following
case localCommunity
public enum TimelineContext {
case home
case `public`
}
}