Skip to content

Commit

Permalink
rename actor SpeakerIconInMemoryCache to `CircularUserIconInMemoryC…
Browse files Browse the repository at this point in the history
…ache`

Because related view is renamed, so I changed it accordingly.
  • Loading branch information
mltokky committed Aug 20, 2024
1 parent 1675750 commit feddd2e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Foundation
import SwiftUI

private actor SpeakerIconInMemoryCache {
static let shared = SpeakerIconInMemoryCache()
private actor CircularUserIconInMemoryCache {
static let shared = CircularUserIconInMemoryCache()
private init() {}

private var cache: [String: Data] = [:]
Expand Down Expand Up @@ -36,7 +36,7 @@ public struct CircularUserIcon: View {
}
.clipShape(Circle())
.task {
if let data = await SpeakerIconInMemoryCache.shared.data(urlString: urlString) {
if let data = await CircularUserIconInMemoryCache.shared.data(urlString: urlString) {
iconData = data
return
}
Expand All @@ -47,7 +47,7 @@ public struct CircularUserIcon: View {
let urlRequest = URLRequest(url: url, cachePolicy: .useProtocolCachePolicy)
if let (data, _) = try? await URLSession.shared.data(for: urlRequest) {

Check warning on line 48 in app-ios/Sources/CommonComponents/Timetable/CircularUserIcon.swift

View workflow job for this annotation

GitHub Actions / build-test-ios

passing argument of non-sendable type '(any URLSessionTaskDelegate)?' outside of main actor-isolated context may introduce data races
iconData = data
await SpeakerIconInMemoryCache.shared.set(data: data, urlString: urlString)
await CircularUserIconInMemoryCache.shared.set(data: data, urlString: urlString)
}
}
}
Expand Down

0 comments on commit feddd2e

Please sign in to comment.