From cf342bf3ae3db937e2715607c6daafd5705e64d9 Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Fri, 25 Sep 2020 20:28:50 -0700 Subject: [PATCH] Renaming --- DB/Sources/DB/Content/ContentDatabase.swift | 4 ++-- DB/Sources/DB/Extensions/Timeline+Extensions.swift | 2 +- Mastodon/Sources/Mastodon/Entities/List.swift | 2 +- Mastodon/Sources/Mastodon/Entities/Timeline.swift | 2 +- MastodonAPI/Sources/MastodonAPI/Endpoints/ListEndpoint.swift | 2 +- MastodonAPI/Sources/MastodonAPI/Endpoints/ListsEndpoint.swift | 2 +- ViewModels/Sources/ViewModels/ListsViewModel.swift | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/DB/Sources/DB/Content/ContentDatabase.swift b/DB/Sources/DB/Content/ContentDatabase.swift index e4171a1..df537c6 100644 --- a/DB/Sources/DB/Content/ContentDatabase.swift +++ b/DB/Sources/DB/Content/ContentDatabase.swift @@ -124,7 +124,7 @@ public extension ContentDatabase { .eraseToAnyPublisher() } - func setLists(_ lists: [MastodonList]) -> AnyPublisher { + func setLists(_ lists: [List]) -> AnyPublisher { databaseQueue.writePublisher { for list in lists { try Timeline.list(list).save($0) @@ -139,7 +139,7 @@ public extension ContentDatabase { .eraseToAnyPublisher() } - func createList(_ list: MastodonList) -> AnyPublisher { + func createList(_ list: List) -> AnyPublisher { databaseQueue.writePublisher(updates: Timeline.list(list).save) .ignoreOutput() .eraseToAnyPublisher() diff --git a/DB/Sources/DB/Extensions/Timeline+Extensions.swift b/DB/Sources/DB/Extensions/Timeline+Extensions.swift index 9d380ed..dd05685 100644 --- a/DB/Sources/DB/Extensions/Timeline+Extensions.swift +++ b/DB/Sources/DB/Extensions/Timeline+Extensions.swift @@ -18,7 +18,7 @@ extension Timeline: FetchableRecord, PersistableRecord { case (Timeline.federated.id, _): self = .federated case (let id, .some(let title)): - self = .list(MastodonList(id: id, title: title)) + self = .list(List(id: id, title: title)) default: var tag: String = row[Columns.id] diff --git a/Mastodon/Sources/Mastodon/Entities/List.swift b/Mastodon/Sources/Mastodon/Entities/List.swift index 6b76a00..53f874f 100644 --- a/Mastodon/Sources/Mastodon/Entities/List.swift +++ b/Mastodon/Sources/Mastodon/Entities/List.swift @@ -2,7 +2,7 @@ import Foundation -public struct MastodonList: Codable, Hashable, Identifiable { +public struct List: Codable, Hashable, Identifiable { public let id: String public let title: String diff --git a/Mastodon/Sources/Mastodon/Entities/Timeline.swift b/Mastodon/Sources/Mastodon/Entities/Timeline.swift index bcbadbc..7984e09 100644 --- a/Mastodon/Sources/Mastodon/Entities/Timeline.swift +++ b/Mastodon/Sources/Mastodon/Entities/Timeline.swift @@ -6,7 +6,7 @@ public enum Timeline: Hashable { case home case local case federated - case list(MastodonList) + case list(List) case tag(String) } diff --git a/MastodonAPI/Sources/MastodonAPI/Endpoints/ListEndpoint.swift b/MastodonAPI/Sources/MastodonAPI/Endpoints/ListEndpoint.swift index 522cc87..4a347f9 100644 --- a/MastodonAPI/Sources/MastodonAPI/Endpoints/ListEndpoint.swift +++ b/MastodonAPI/Sources/MastodonAPI/Endpoints/ListEndpoint.swift @@ -9,7 +9,7 @@ public enum ListEndpoint { } extension ListEndpoint: Endpoint { - public typealias ResultType = MastodonList + public typealias ResultType = List public var context: [String] { defaultContext + ["lists"] diff --git a/MastodonAPI/Sources/MastodonAPI/Endpoints/ListsEndpoint.swift b/MastodonAPI/Sources/MastodonAPI/Endpoints/ListsEndpoint.swift index b9894fb..5791ee0 100644 --- a/MastodonAPI/Sources/MastodonAPI/Endpoints/ListsEndpoint.swift +++ b/MastodonAPI/Sources/MastodonAPI/Endpoints/ListsEndpoint.swift @@ -9,7 +9,7 @@ public enum ListsEndpoint { } extension ListsEndpoint: Endpoint { - public typealias ResultType = [MastodonList] + public typealias ResultType = [List] public var pathComponentsInContext: [String] { ["lists"] diff --git a/ViewModels/Sources/ViewModels/ListsViewModel.swift b/ViewModels/Sources/ViewModels/ListsViewModel.swift index a0cd8ac..e3d5291 100644 --- a/ViewModels/Sources/ViewModels/ListsViewModel.swift +++ b/ViewModels/Sources/ViewModels/ListsViewModel.swift @@ -6,7 +6,7 @@ import Mastodon import ServiceLayer public final class ListsViewModel: ObservableObject { - @Published public private(set) var lists = [MastodonList]() + @Published public private(set) var lists = [List]() @Published public private(set) var creatingList = false @Published public var alertItem: AlertItem? @@ -47,7 +47,7 @@ public extension ListsViewModel { .store(in: &cancellables) } - func delete(list: MastodonList) { + func delete(list: List) { identification.service.deleteList(id: list.id) .assignErrorsToAlertItem(to: \.alertItem, on: self) .sink { _ in }