From 9ac6ed2d93ef59759eec6c2e60969283b2315ac7 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Mon, 5 Oct 2020 13:22:47 -0700 Subject: [PATCH] Renaming --- .../ServiceLayer/Services/ContextService.swift | 16 ++++++++-------- .../Services/NavigationService.swift | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ServiceLayer/Sources/ServiceLayer/Services/ContextService.swift b/ServiceLayer/Sources/ServiceLayer/Services/ContextService.swift index 55e33d2..b2cfa8d 100644 --- a/ServiceLayer/Sources/ServiceLayer/Services/ContextService.swift +++ b/ServiceLayer/Sources/ServiceLayer/Services/ContextService.swift @@ -9,27 +9,27 @@ import MastodonAPI public struct ContextService { public let sections: AnyPublisher<[[CollectionItem]], Error> public let navigationService: NavigationService - public var contextParentID: String? { statusID } + public var contextParentID: String? { parentID } - private let statusID: String + private let parentID: String private let mastodonAPIClient: MastodonAPIClient private let contentDatabase: ContentDatabase - init(statusID: String, mastodonAPIClient: MastodonAPIClient, contentDatabase: ContentDatabase) { - self.statusID = statusID + init(parentID: String, mastodonAPIClient: MastodonAPIClient, contentDatabase: ContentDatabase) { + self.parentID = parentID self.mastodonAPIClient = mastodonAPIClient self.contentDatabase = contentDatabase - sections = contentDatabase.contextObservation(parentID: statusID) + sections = contentDatabase.contextObservation(parentID: parentID) navigationService = NavigationService(mastodonAPIClient: mastodonAPIClient, contentDatabase: contentDatabase) } } extension ContextService: CollectionService { public func request(maxID: String?, minID: String?) -> AnyPublisher { - mastodonAPIClient.request(StatusEndpoint.status(id: statusID)) + mastodonAPIClient.request(StatusEndpoint.status(id: parentID)) .flatMap(contentDatabase.insert(status:)) - .merge(with: mastodonAPIClient.request(ContextEndpoint.context(id: statusID)) - .flatMap { contentDatabase.insert(context: $0, parentID: statusID) }) + .merge(with: mastodonAPIClient.request(ContextEndpoint.context(id: parentID)) + .flatMap { contentDatabase.insert(context: $0, parentID: parentID) }) .eraseToAnyPublisher() } } diff --git a/ServiceLayer/Sources/ServiceLayer/Services/NavigationService.swift b/ServiceLayer/Sources/ServiceLayer/Services/NavigationService.swift index 613af34..e80ed7d 100644 --- a/ServiceLayer/Sources/ServiceLayer/Services/NavigationService.swift +++ b/ServiceLayer/Sources/ServiceLayer/Services/NavigationService.swift @@ -50,7 +50,7 @@ public extension NavigationService { } func contextService(id: String) -> ContextService { - ContextService(statusID: id, mastodonAPIClient: mastodonAPIClient, contentDatabase: contentDatabase) + ContextService(parentID: id, mastodonAPIClient: mastodonAPIClient, contentDatabase: contentDatabase) } func profileService(id: String) -> ProfileService {