Fix warnings and remove unused code (IOS-192)

This commit is contained in:
Nathan Mattes 2024-01-02 15:37:07 +01:00
parent d1b5b9fc98
commit 7f26dfa6d6
3 changed files with 1 additions and 75 deletions

View File

@ -11,14 +11,6 @@ import MastodonCore
import MastodonSDK
extension DataSourceFacade {
@MainActor
static func coordinateToHashtagScene(
provider: DataSourceProvider & AuthContextProvider,
tag: Mastodon.Entity.Tag
) async {
await coordinateToHashtagScene(provider: provider, tag: tag)
}
@MainActor
static func coordinateToHashtagScene(
provider: ViewControllerWithDependencies & AuthContextProvider,

View File

@ -75,7 +75,7 @@ extension SearchHistoryViewController: UICollectionViewDelegate {
switch item {
case .account(account: let account, relationship: _):
await DataSourceFacade.coordinateToProfileScene(provider: self, account: account)
DataSourceFacade.coordinateToProfileScene(provider: self, account: account)
case .hashtag(let tag):
await DataSourceFacade.coordinateToHashtagScene(

View File

@ -1,66 +0,0 @@
//
// ComposeStatusItem.swift
// Mastodon
//
// Created by MainasuK Cirno on 2021-3-11.
//
import Foundation
import Combine
import CoreData
import MastodonMeta
import CoreDataStack
/// Note: update Equatable when change case
enum ComposeStatusItem {
case replyTo(record: ManagedObjectRecord<Status>)
case input(replyTo: ManagedObjectRecord<Status>?, attribute: ComposeStatusAttribute)
case attachment(attachmentAttribute: ComposeStatusAttachmentAttribute)
case pollOption(pollOptionAttributes: [ComposeStatusPollItem.PollOptionAttribute], pollExpiresOptionAttribute: ComposeStatusPollItem.PollExpiresOptionAttribute)
}
extension ComposeStatusItem: Hashable { }
extension ComposeStatusItem {
final class ComposeStatusAttribute: Hashable {
private let id = UUID()
@Published var author: ManagedObjectRecord<MastodonUser>?
@Published var composeContent: String?
@Published var isContentWarningComposing = false
@Published var contentWarningContent = ""
static func == (lhs: ComposeStatusAttribute, rhs: ComposeStatusAttribute) -> Bool {
return lhs.author == rhs.author
&& lhs.composeContent == rhs.composeContent
&& lhs.isContentWarningComposing == rhs.isContentWarningComposing
&& lhs.contentWarningContent == rhs.contentWarningContent
}
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
}
}
extension ComposeStatusItem {
final class ComposeStatusAttachmentAttribute: Hashable {
private let id = UUID()
var attachmentServices: [MastodonAttachmentService]
init(attachmentServices: [MastodonAttachmentService]) {
self.attachmentServices = attachmentServices
}
static func == (lhs: ComposeStatusAttachmentAttribute, rhs: ComposeStatusAttachmentAttribute) -> Bool {
return lhs.attachmentServices == rhs.attachmentServices
}
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
}
}