From f3aa07073628ccf7f36ae3ae88609240d87859f5 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Wed, 13 Mar 2024 07:08:52 +0100 Subject: [PATCH] fix crash on deleteApiCall --- LeStorage/Services.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LeStorage/Services.swift b/LeStorage/Services.swift index 5e9ac20..3d36faa 100644 --- a/LeStorage/Services.swift +++ b/LeStorage/Services.swift @@ -104,7 +104,9 @@ public class Services { case 200...300: if let apiCallId, let collectionName = (T.self as? any Storable.Type)?.resourceName() { - try Store.main.deleteApiCallById(apiCallId, collectionName: collectionName) + try await MainActor.run { + try Store.main.deleteApiCallById(apiCallId, collectionName: collectionName) + } } default: if let apiCallId, let type = (T.self as? any Storable.Type) {