From ce266fbeb1151c0aa8904fd48eb215fde3bb4229 Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Fri, 14 Feb 2025 10:56:07 +0100 Subject: [PATCH] Clean up orphaned activities as well --- Views/LiveActivity/ActivityService.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Views/LiveActivity/ActivityService.swift b/Views/LiveActivity/ActivityService.swift index 2ac344a3..e3380947 100644 --- a/Views/LiveActivity/ActivityService.swift +++ b/Views/LiveActivity/ActivityService.swift @@ -135,6 +135,10 @@ final class ActivityService { activity = nil isStarted = false downloadTimes = [:] + // make sure we clean up orphan activities of the same type as well + for activity in Activity.activities { + await activity.end(nil, dismissalPolicy: .immediate) + } } }