This commit is contained in:
Justin Mazzocchi 2020-09-25 20:28:50 -07:00
parent 745a420c19
commit cf342bf3ae
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
7 changed files with 9 additions and 9 deletions

View file

@ -124,7 +124,7 @@ public extension ContentDatabase {
.eraseToAnyPublisher()
}
func setLists(_ lists: [MastodonList]) -> AnyPublisher<Never, Error> {
func setLists(_ lists: [List]) -> AnyPublisher<Never, Error> {
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<Never, Error> {
func createList(_ list: List) -> AnyPublisher<Never, Error> {
databaseQueue.writePublisher(updates: Timeline.list(list).save)
.ignoreOutput()
.eraseToAnyPublisher()

View file

@ -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]

View file

@ -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

View file

@ -6,7 +6,7 @@ public enum Timeline: Hashable {
case home
case local
case federated
case list(MastodonList)
case list(List)
case tag(String)
}

View file

@ -9,7 +9,7 @@ public enum ListEndpoint {
}
extension ListEndpoint: Endpoint {
public typealias ResultType = MastodonList
public typealias ResultType = List
public var context: [String] {
defaultContext + ["lists"]

View file

@ -9,7 +9,7 @@ public enum ListsEndpoint {
}
extension ListsEndpoint: Endpoint {
public typealias ResultType = [MastodonList]
public typealias ResultType = [List]
public var pathComponentsInContext: [String] {
["lists"]

View file

@ -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 }