Fix some warnings

This commit is contained in:
Nathan Mattes 2023-08-21 11:32:00 +02:00
parent a20f9a57c2
commit 075b8a739a
6 changed files with 3 additions and 10 deletions

View File

@ -22,9 +22,6 @@ extension DiscoveryCommunityViewModel {
override func didEnter(from previousState: GKState?) {
super.didEnter(from: previousState)
let from = previousState.flatMap { String(describing: $0) } ?? "nil"
let to = String(describing: self)
}
@MainActor

View File

@ -236,7 +236,6 @@ class MastodonLoginViewController: UIViewController, NeedsDependency {
let keyboardFrame = keyboardFrameValue.cgRectValue
let keyboardOrigin = view.convert(keyboardFrame.origin, from: nil)
let intersectionY = CGRectGetMaxY(view.frame) - keyboardOrigin.y;
UIView.animate(withDuration: duration.doubleValue, delay: 0, options: .curveEaseInOut) {
self.view.layoutIfNeeded()

View File

@ -333,7 +333,7 @@ extension WelcomeViewController {
self.authenticationViewModel.isAuthenticating.send(false)
switch completion {
case .failure(let error ):
case .failure(_):
guard let randomServer = self.viewModel.pickRandomDefaultServer() else { return }
self.viewModel.randomDefaultServer = randomServer

View File

@ -85,7 +85,7 @@ extension ThreadViewModel.LoadThreadState {
// assert(!Thread.isMainThread)
// await Task.sleep(1_000_000_000) // 1s delay to prevent UI render issue
let statusHistory = try await viewModel.context.apiService.getHistory(forStatusID: threadContext.statusID,
_ = try await viewModel.context.apiService.getHistory(forStatusID: threadContext.statusID,
authenticationBox: viewModel.authContext.mastodonAuthenticationBox)
viewModel.mastodonStatusThreadViewModel.appendAncestor(

View File

@ -480,8 +480,6 @@ extension ComposeContentViewModel {
)
.receive(on: DispatchQueue.main)
.map { contentWarning, content, hasPoll, attachments in
let canDiscardContentWarning = contentWarning.isEmpty
let trimmedContent = content.trimmingCharacters(in: .whitespacesAndNewlines)
let initialContent = self.initialContent.trimmingCharacters(in: .whitespacesAndNewlines)
let canDiscardContent = trimmedContent.isEmpty || trimmedContent == initialContent

View File

@ -5,6 +5,7 @@ import CoreData
import CoreDataStack
import MastodonCore
import MastodonSDK
import Combine
public final class MastodonEditStatusPublisher: NSObject, ProgressReporting {
@ -77,8 +78,6 @@ extension MastodonEditStatusPublisher: StatusPublisher {
api: APIService,
authContext: AuthContext
) async throws -> StatusPublishResult {
let idempotencyKey = UUID().uuidString
let publishStatusTaskStartDelayWeight: Int64 = 20
let publishStatusTaskStartDelayCount: Int64 = publishStatusTaskStartDelayWeight