Connect to several servers, one coloured window each
This commit is contained in:
@@ -38,7 +38,6 @@ func worktreeImageSource(_ path: String, _ taskId: String?, dir: String = "") ->
|
||||
|
||||
@MainActor
|
||||
final class ImageCache {
|
||||
static let shared = ImageCache()
|
||||
private var done: [ImageSource: NSImage] = [:]
|
||||
private var loading: [ImageSource: Task<NSImage, any Error>] = [:]
|
||||
|
||||
@@ -99,7 +98,7 @@ struct ByreImage: View {
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
if let image = image ?? ImageCache.shared.cached(source) {
|
||||
if let image = image ?? store.imageCache.cached(source) {
|
||||
Image(nsImage: image)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
@@ -122,7 +121,7 @@ struct ByreImage: View {
|
||||
return
|
||||
}
|
||||
do {
|
||||
image = try await ImageCache.shared.load(source, store.api)
|
||||
image = try await store.imageCache.load(source, store.api)
|
||||
} catch {
|
||||
log.error("load image \(src, privacy: .public): \(errorText(error), privacy: .public)")
|
||||
failed = true
|
||||
|
||||
Reference in New Issue
Block a user