Skip to content

Commit

Permalink
Fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitschlag committed Nov 16, 2023
1 parent 9947335 commit 4014a1b
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 37 deletions.
12 changes: 0 additions & 12 deletions MastodonSDK/Sources/CoreDataStack/CoreDataStack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,6 @@ public final class CoreDataStack {
container.viewContext.automaticallyMergesChangesFromParent = true

callback()

#if DEBUG
do {
let storeURL = URL.storeURL(for: AppName.groupID, databaseName: "shared")
let data = try Data(contentsOf: storeURL)
let formatter = ByteCountFormatter()
formatter.allowedUnits = [.useMB]
formatter.countStyle = .file
let size = formatter.string(fromByteCount: Int64(data.count))
} catch {
}
#endif
})
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ extension APIService {
domain: domain,
authorization: authorization).singleOutput()

let responseHistory = try await Mastodon.API.Statuses.editHistory(
_ = try await Mastodon.API.Statuses.editHistory(
forStatusID: statusID,
session: session,
domain: domain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ extension NotificationService {
}

private func authenticationBox(for pushNotification: MastodonPushNotification) async throws -> MastodonAuthenticationBox? {
guard let authenticationService = self.authenticationService else { return nil }
guard self.authenticationService != nil else { return nil }
let results = AuthenticationServiceProvider.shared.authentications.filter { $0.userAccessToken == pushNotification.accessToken }
guard let authentication = results.first else { return nil }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension ComposeContentViewModel: UITextViewDelegate {
switch textView {
case contentMetaText?.textView:
// update model
guard let metaText = self.contentMetaText else {
guard self.contentMetaText != nil else {
assertionFailure()
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public final class ComposeContentViewModel: NSObject, ObservableObject {

let recentLanguages = context.settingService.currentSetting.value?.recentLanguages ?? []
self.recentLanguages = recentLanguages
self.language = recentLanguages.first ?? Locale.current.languageCode ?? "en"
self.language = recentLanguages.first ?? Locale.current.language.languageCode?.identifier ?? "en"
super.init()
// end init

Expand Down Expand Up @@ -490,7 +490,7 @@ extension ComposeContentViewModel {
.flatMap { settings in
if let settings {
return settings.publisher(for: \.recentLanguages, options: .initial).eraseToAnyPublisher()
} else if let code = Locale.current.languageCode {
} else if let code = Locale.current.language.languageCode?.identifier {
return Just([code]).eraseToAnyPublisher()
}
return Just([]).eraseToAnyPublisher()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension ComposeContentToolbarView {
@Published var isAttachmentButtonEnabled = false
@Published var isPollButtonEnabled = false

@Published var language = Locale.current.languageCode ?? "en"
@Published var language = Locale.current.language.languageCode?.identifier ?? "en"
@Published var recentLanguages: [String] = []

@Published public var maxTextInputLimit = 500
Expand Down

0 comments on commit 4014a1b

Please sign in to comment.