diff --git a/Provenance.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Provenance.xcworkspace/xcshareddata/swiftpm/Package.resolved index d4cfc4afa1..f1027a84a2 100644 --- a/Provenance.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Provenance.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -87,8 +87,8 @@ "repositoryURL": "https://github.com/FlineDev/FreemiumKit.git", "state": { "branch": null, - "revision": "68a3c35053afe0c564585da4f16315e1bbcda441", - "version": "1.14.0" + "revision": "ff45d8e3fc7af5255f97e059cc95524dfa320196", + "version": "1.15.0" } }, { @@ -285,7 +285,7 @@ "repositoryURL": "https://github.com/pointfreeco/swift-perception.git", "state": { "branch": "main", - "revision": "dccdf5aed1db969afa11d6fbd36b96a4932ebe8c", + "revision": "8d52279b9809ef27eabe7d5420f03734528f19da", "version": null } }, diff --git a/Provenance/Main UI/PVAppDelegate.swift b/Provenance/Main UI/PVAppDelegate.swift index 5a416cd85a..a20d5fa65c 100644 --- a/Provenance/Main UI/PVAppDelegate.swift +++ b/Provenance/Main UI/PVAppDelegate.swift @@ -102,13 +102,16 @@ final class PVAppDelegate: UIResponder, GameLaunchingAppDelegate, UIApplicationD /// Reimport the library NotificationCenter.default.publisher(for: .PVReimportLibrary) .flatMap { _ in + Future { promise in - RomDatabase.refresh() - if let _ = self.gameLibraryViewController { - self.gameLibraryViewController?.checkROMs(false) - } else { - if let updates = await self.appState?.libraryUpdatesController { - await updates.importROMDirectories() + Task.detached { @MainActor in + RomDatabase.refresh() + if let _ = self.gameLibraryViewController { + self.gameLibraryViewController?.checkROMs(false) + } else { + if let updates = await self.appState?.libraryUpdatesController { + await updates.importROMDirectories() + } } } promise(.success(())) @@ -121,19 +124,21 @@ final class PVAppDelegate: UIResponder, GameLaunchingAppDelegate, UIApplicationD NotificationCenter.default.publisher(for: .PVRefreshLibrary) .flatMap { _ in Future { promise in - do { - try RomDatabase.sharedInstance.deleteAllGames() - if let _ = self.gameLibraryViewController { - self.gameLibraryViewController?.checkROMs(false) - } else { - if let updates = await self.appState?.libraryUpdatesController { - await updates.importROMDirectories() + Task { @MainActor in + do { + try RomDatabase.sharedInstance.deleteAllGames() + if let _ = self.gameLibraryViewController { + self.gameLibraryViewController?.checkROMs(false) + } else { + if let updates = await self.appState?.libraryUpdatesController { + await updates.importROMDirectories() + } } + promise(.success(())) + } catch { + ELOG("Failed to refresh all objects. \(error.localizedDescription)") + promise(.failure(error)) } - promise(.success(())) - } catch { - ELOG("Failed to refresh all objects. \(error.localizedDescription)") - promise(.failure(error)) } } }