Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some warnings #1274

Merged
merged 5 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading