Fix concurrency warning in IconImage. Make RSImage.appIconImage let instead of var.

This commit is contained in:
Brent Simmons 2024-04-01 23:11:30 -07:00
parent 9d6d15bd93
commit 3e37388604

View File

@ -10,7 +10,7 @@ import Foundation
import Core import Core
extension RSImage { extension RSImage {
static var appIconImage: RSImage? { static let appIconImage: RSImage? = {
#if os(macOS) #if os(macOS)
return RSImage(named: NSImage.applicationIconName) return RSImage(named: NSImage.applicationIconName)
#elseif os(iOS) #elseif os(iOS)
@ -23,11 +23,11 @@ extension RSImage {
} }
return nil return nil
#endif #endif
} }()
} }
extension IconImage { extension IconImage {
static let appIcon: IconImage? = { @MainActor static let appIcon: IconImage? = {
if let image = RSImage.appIconImage { if let image = RSImage.appIconImage {
return IconImage(image) return IconImage(image)
} }