Skip to content

Commit

Permalink
Merge pull request #1274 from RomanPodymov/main
Browse files Browse the repository at this point in the history
Fix some warnings
  • Loading branch information
mplorentz authored Jul 24, 2024
2 parents 77261a3 + 2d0af52 commit 45e5f08
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions Source/App/AppConfiguration+Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ 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") }
let unarchiver = try? NSKeyedUnarchiver(forReadingFrom: data)
unarchiver?.requiresSecureCoding = false
guard let configuration = unarchiver?.decodeObject(of: self, forKey: NSKeyedArchiveRootObjectKey) 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
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 45e5f08

Please sign in to comment.