macOS: silent weak ownership difference warnings

UpdateViewModel doesn't own the Task, we don't actually need it here.
This commit is contained in:
Lukas
2026-07-23 22:53:26 +02:00
parent c78226bfae
commit cb7eaa059d

View File

@@ -24,10 +24,10 @@ struct UpdatePill: View {
.onChange(of: model.state) { newState in
resetTask?.cancel()
if case .notFound(let notFound) = newState {
resetTask = Task { [weak model] in
resetTask = Task {
try? await Task.sleep(for: .seconds(5))
guard !Task.isCancelled, case .notFound? = model?.state else { return }
model?.state = .idle
guard !Task.isCancelled, case .notFound = model.state else { return }
model.state = .idle
notFound.acknowledgement()
}
} else {