mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-28 19:11:30 +00:00
Renaming
This commit is contained in:
parent
745a420c19
commit
cf342bf3ae
7 changed files with 9 additions and 9 deletions
|
@ -124,7 +124,7 @@ public extension ContentDatabase {
|
||||||
.eraseToAnyPublisher()
|
.eraseToAnyPublisher()
|
||||||
}
|
}
|
||||||
|
|
||||||
func setLists(_ lists: [MastodonList]) -> AnyPublisher<Never, Error> {
|
func setLists(_ lists: [List]) -> AnyPublisher<Never, Error> {
|
||||||
databaseQueue.writePublisher {
|
databaseQueue.writePublisher {
|
||||||
for list in lists {
|
for list in lists {
|
||||||
try Timeline.list(list).save($0)
|
try Timeline.list(list).save($0)
|
||||||
|
@ -139,7 +139,7 @@ public extension ContentDatabase {
|
||||||
.eraseToAnyPublisher()
|
.eraseToAnyPublisher()
|
||||||
}
|
}
|
||||||
|
|
||||||
func createList(_ list: MastodonList) -> AnyPublisher<Never, Error> {
|
func createList(_ list: List) -> AnyPublisher<Never, Error> {
|
||||||
databaseQueue.writePublisher(updates: Timeline.list(list).save)
|
databaseQueue.writePublisher(updates: Timeline.list(list).save)
|
||||||
.ignoreOutput()
|
.ignoreOutput()
|
||||||
.eraseToAnyPublisher()
|
.eraseToAnyPublisher()
|
||||||
|
|
|
@ -18,7 +18,7 @@ extension Timeline: FetchableRecord, PersistableRecord {
|
||||||
case (Timeline.federated.id, _):
|
case (Timeline.federated.id, _):
|
||||||
self = .federated
|
self = .federated
|
||||||
case (let id, .some(let title)):
|
case (let id, .some(let title)):
|
||||||
self = .list(MastodonList(id: id, title: title))
|
self = .list(List(id: id, title: title))
|
||||||
default:
|
default:
|
||||||
var tag: String = row[Columns.id]
|
var tag: String = row[Columns.id]
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public struct MastodonList: Codable, Hashable, Identifiable {
|
public struct List: Codable, Hashable, Identifiable {
|
||||||
public let id: String
|
public let id: String
|
||||||
public let title: String
|
public let title: String
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ public enum Timeline: Hashable {
|
||||||
case home
|
case home
|
||||||
case local
|
case local
|
||||||
case federated
|
case federated
|
||||||
case list(MastodonList)
|
case list(List)
|
||||||
case tag(String)
|
case tag(String)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ public enum ListEndpoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ListEndpoint: Endpoint {
|
extension ListEndpoint: Endpoint {
|
||||||
public typealias ResultType = MastodonList
|
public typealias ResultType = List
|
||||||
|
|
||||||
public var context: [String] {
|
public var context: [String] {
|
||||||
defaultContext + ["lists"]
|
defaultContext + ["lists"]
|
||||||
|
|
|
@ -9,7 +9,7 @@ public enum ListsEndpoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ListsEndpoint: Endpoint {
|
extension ListsEndpoint: Endpoint {
|
||||||
public typealias ResultType = [MastodonList]
|
public typealias ResultType = [List]
|
||||||
|
|
||||||
public var pathComponentsInContext: [String] {
|
public var pathComponentsInContext: [String] {
|
||||||
["lists"]
|
["lists"]
|
||||||
|
|
|
@ -6,7 +6,7 @@ import Mastodon
|
||||||
import ServiceLayer
|
import ServiceLayer
|
||||||
|
|
||||||
public final class ListsViewModel: ObservableObject {
|
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 private(set) var creatingList = false
|
||||||
@Published public var alertItem: AlertItem?
|
@Published public var alertItem: AlertItem?
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public extension ListsViewModel {
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
}
|
}
|
||||||
|
|
||||||
func delete(list: MastodonList) {
|
func delete(list: List) {
|
||||||
identification.service.deleteList(id: list.id)
|
identification.service.deleteList(id: list.id)
|
||||||
.assignErrorsToAlertItem(to: \.alertItem, on: self)
|
.assignErrorsToAlertItem(to: \.alertItem, on: self)
|
||||||
.sink { _ in }
|
.sink { _ in }
|
||||||
|
|
Loading…
Reference in a new issue