Fix unused-warnings
This commit is contained in:
parent
95fdc7616f
commit
7fa891308a
|
@ -51,9 +51,8 @@ extension NotificationTableViewCell {
|
|||
)
|
||||
.dropFirst()
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak tableView, weak self] _, _ in
|
||||
.sink { [weak tableView] _, _ in
|
||||
guard let tableView = tableView else { return }
|
||||
guard let self = self else { return }
|
||||
|
||||
UIView.performWithoutAnimation {
|
||||
tableView.beginUpdates()
|
||||
|
|
|
@ -26,11 +26,6 @@ extension ReportStatusViewModel {
|
|||
self.viewModel = viewModel
|
||||
}
|
||||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
let previousState = previousState as? ReportStatusViewModel.State
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func enter(state: State.Type) {
|
||||
stateMachine?.enter(state)
|
||||
|
|
|
@ -34,14 +34,7 @@ extension AuthContext {
|
|||
|
||||
ManagedObjectObserver.observe(object: authentication)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] completion in
|
||||
guard let self = self else { return }
|
||||
switch completion {
|
||||
case .failure(_):
|
||||
break
|
||||
case .finished:
|
||||
break
|
||||
}
|
||||
.sink { _ in
|
||||
} receiveValue: { [weak self] change in
|
||||
guard let self = self else { return }
|
||||
switch change.changeType {
|
||||
|
|
|
@ -81,8 +81,6 @@ extension NSItemProvider {
|
|||
CGImageDestinationAddImage(imageDestination, cgImage, destinationProperties)
|
||||
CGImageDestinationFinalize(imageDestination)
|
||||
|
||||
let dataSize = ByteCountFormatter.string(fromByteCount: Int64(data.length), countStyle: .memory)
|
||||
|
||||
let result = ImageLoadResult(
|
||||
data: data as Data,
|
||||
type: cgImage.utType.flatMap { UTType($0 as String) }
|
||||
|
|
|
@ -36,7 +36,7 @@ extension APIService {
|
|||
|
||||
let managedObjectContext = self.backgroundManagedObjectContext
|
||||
try await managedObjectContext.performChanges {
|
||||
let result = Persistence.MastodonUser.createOrMerge(
|
||||
_ = Persistence.MastodonUser.createOrMerge(
|
||||
in: managedObjectContext,
|
||||
context: Persistence.MastodonUser.PersistContext(
|
||||
domain: domain,
|
||||
|
@ -68,7 +68,7 @@ extension APIService {
|
|||
|
||||
let managedObjectContext = self.backgroundManagedObjectContext
|
||||
return managedObjectContext.performChanges {
|
||||
let result = Persistence.MastodonUser.createOrMerge(
|
||||
_ = Persistence.MastodonUser.createOrMerge(
|
||||
in: managedObjectContext,
|
||||
context: Persistence.MastodonUser.PersistContext(
|
||||
domain: domain,
|
||||
|
@ -106,7 +106,7 @@ extension APIService {
|
|||
|
||||
let managedObjectContext = self.backgroundManagedObjectContext
|
||||
try await managedObjectContext.performChanges {
|
||||
let result = Persistence.MastodonUser.createOrMerge(
|
||||
_ = Persistence.MastodonUser.createOrMerge(
|
||||
in: managedObjectContext,
|
||||
context: Persistence.MastodonUser.PersistContext(
|
||||
domain: domain,
|
||||
|
|
|
@ -102,7 +102,6 @@ extension APIService {
|
|||
networkDate: response.networkDate
|
||||
)
|
||||
)
|
||||
let following = response.value.following
|
||||
case .failure:
|
||||
// rollback
|
||||
user.update(isFollowing: followContext.isFollowing, by: me)
|
||||
|
|
|
@ -59,14 +59,7 @@ extension InstanceService {
|
|||
// .flatMap { [unowned self] response -> AnyPublisher<Void, Error> in
|
||||
// return
|
||||
// }
|
||||
.sink { [weak self] completion in
|
||||
guard let self = self else { return }
|
||||
switch completion {
|
||||
case .failure(_):
|
||||
break
|
||||
case .finished:
|
||||
break
|
||||
}
|
||||
.sink { _ in
|
||||
} receiveValue: { [weak self] response in
|
||||
guard let _ = self else { return }
|
||||
// do nothing
|
||||
|
|
|
@ -88,8 +88,6 @@ public enum ItemProviderLoader {
|
|||
CGImageDestinationAddImage(imageDestination, cgImage, destinationProperties)
|
||||
CGImageDestinationFinalize(imageDestination)
|
||||
|
||||
let dataSize = ByteCountFormatter.string(fromByteCount: Int64(data.length), countStyle: .memory)
|
||||
|
||||
let file = Mastodon.Query.MediaAttachment.jpeg(data as Data)
|
||||
promise(.success(file))
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ extension AttachmentViewModel {
|
|||
).singleOutput()
|
||||
progress.completedUnitCount += checkUploadTaskCount
|
||||
|
||||
if let url = attachmentStatusResponse.value.url {
|
||||
if attachmentStatusResponse.value.url != nil {
|
||||
// escape here
|
||||
progress.completedUnitCount = progress.totalUnitCount
|
||||
return .uploadedMastodonAttachment(attachmentStatusResponse.value)
|
||||
|
|
|
@ -35,8 +35,6 @@ extension ComposeContentViewModel: UITextViewDelegate {
|
|||
assertionFailure()
|
||||
return
|
||||
}
|
||||
let backedString = metaText.backedString
|
||||
|
||||
// configure auto completion
|
||||
setupAutoComplete(for: textView)
|
||||
|
||||
|
|
|
@ -789,7 +789,6 @@ extension ComposeContentViewModel: AttachmentViewModelDelegate {
|
|||
case .compressing:
|
||||
return
|
||||
case .ready:
|
||||
let count = self.attachmentViewModels.count
|
||||
try await attachmentViewModel.upload()
|
||||
return
|
||||
case .uploading:
|
||||
|
|
|
@ -393,9 +393,7 @@ extension StatusView.ViewModel {
|
|||
|
||||
private func bindMedia(statusView: StatusView) {
|
||||
$mediaViewConfigurations
|
||||
.sink { [weak self] configurations in
|
||||
guard let self = self else { return }
|
||||
|
||||
.sink { configurations in
|
||||
statusView.mediaGridContainerView.prepareForReuse()
|
||||
|
||||
let maxSize = CGSize(
|
||||
|
|
|
@ -93,7 +93,6 @@ class FollowersCountHistory {
|
|||
let history = followersHistorySorted(for: account)
|
||||
let relevantDays = elapsedFollowersCountDateStrings()
|
||||
let today = relevantDays.last!
|
||||
let yesterday = relevantDays[relevantDays.count - 2]
|
||||
|
||||
let followersToday = history.first(where: { $0.dstring == today })?.count ?? account.followersCount
|
||||
let followersYesterday = history[safe: history.count-2]?.count ?? account.followersCount
|
||||
|
|
Loading…
Reference in New Issue