Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Oct 23, 2023
1 parent c56eb8d commit b343098
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
7 changes: 4 additions & 3 deletions Source/App/AppConfiguration+Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ extension AppConfiguration {
}

static func from(_ data: Data) -> AppConfiguration? {
guard let object = try? NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(data) else { return nil }
let configuration = object as? AppConfiguration
if configuration == nil { Log.unexpected(.missingValue, "Configuration could not be unarchived") }
guard let configuration = try? NSKeyedUnarchiver.unarchivedObject(ofClass: AppConfiguration.self, from: data) else {
Log.unexpected(.missingValue, "Configuration could not be unarchived")
return nil
}
return configuration
}
}
Expand Down
4 changes: 4 additions & 0 deletions Source/Controller/BlobViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class BlobViewController: ContentViewController {
forgetBlobCompletion()

Task { @MainActor [weak self] in
guard let blob = self?.blob else {
return
}

// cached image
if let uiImage = Caches.blobs.image(for: blob) {
self?.imageView.image = uiImage
Expand Down
2 changes: 1 addition & 1 deletion Source/Controller/LaunchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class LaunchViewController: UIViewController {
}

// if no configuration then onboard
guard var configuration = appConfiguration else {
guard let configuration = appConfiguration else {
launchIntoOnboarding()
return
}
Expand Down
1 change: 0 additions & 1 deletion Source/Controller/ThreadViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ class ThreadViewController: ContentViewController {
let post = Post(attributedText: text, root: self.rootKey, branches: [self.branchKey])
let images = self.galleryView.images
let draftStore = draftStore
let textValue = AttributedString(text)
Task.detached(priority: .userInitiated) {
do {
let messageID = try await Bots.current.publish(post, with: images)
Expand Down
2 changes: 1 addition & 1 deletion Source/Onboarding/Steps/JoinOnboardingStep.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import CrashReporting
}

Task { [weak self] in
var context: Onboarding.Context?
let context: Onboarding.Context?

do {
context = try await Onboarding.createProfile(from: data)
Expand Down
2 changes: 1 addition & 1 deletion Source/UI/Identity/ImageMetadataView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fileprivate class ImageLoader: ObservableObject {

await MainActor.run { [weak self] in
guard let metadata = metadata, metadata.link != .null else {
isLoading = false
self?.isLoading = false
return
}

Expand Down
2 changes: 1 addition & 1 deletion Source/UI/ManageAliasView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct RoomAlias: Identifiable {
var authorID: Int64

var alias: String {
var components = string.replacingOccurrences(of: "https://", with: "")
let components = string.replacingOccurrences(of: "https://", with: "")
.replacingOccurrences(of: "http://", with: "")
.components(separatedBy: ".")
return components.joined(separator: ".")
Expand Down

0 comments on commit b343098

Please sign in to comment.