Skip to content

Commit

Permalink
Merge pull request #2362 from Provenance-Emu/bugfix/resetmenuoptions
Browse files Browse the repository at this point in the history
Bugfix - fixes reset settings menu items that weren't hooked up in SwiftUI
  • Loading branch information
JoeMatt authored Nov 28, 2024
2 parents 43324a3 + 1645d18 commit 4b7762c
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions Provenance/Main UI/PVAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ final class PVAppDelegate: UIResponder, GameLaunchingAppDelegate, UIApplicationD
.flatMap { _ in
Future<Void, Never> { promise in
RomDatabase.refresh()
self.gameLibraryViewController?.checkROMs(false)
if let _ = self.gameLibraryViewController {
self.gameLibraryViewController?.checkROMs(false)
} else {
if let updates = await self.appState?.libraryUpdatesController {
await updates.importROMDirectories()
}
}
promise(.success(()))
}
}
Expand All @@ -117,7 +123,13 @@ final class PVAppDelegate: UIResponder, GameLaunchingAppDelegate, UIApplicationD
Future<Void, Error> { promise in
do {
try RomDatabase.sharedInstance.deleteAllGames()
self.gameLibraryViewController?.checkROMs(false)
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)")
Expand All @@ -137,7 +149,13 @@ final class PVAppDelegate: UIResponder, GameLaunchingAppDelegate, UIApplicationD
try RomDatabase.sharedInstance.deleteAllData()
Task {
await GameImporter.shared.initSystems()
self.gameLibraryViewController?.checkROMs(false)
if let _ = self.gameLibraryViewController {
self.gameLibraryViewController?.checkROMs(false)
} else {
if let updates = await self.appState?.libraryUpdatesController {
await updates.importROMDirectories()
}
}
promise(.success(()))
}
} catch {
Expand Down Expand Up @@ -520,6 +538,7 @@ final class PVAppDelegate: UIResponder, GameLaunchingAppDelegate, UIApplicationD
viewModel: viewModel,
rootViewController: rootViewController)

_initLibraryNotificationHandlers()
return sideNav
}

Expand Down

0 comments on commit 4b7762c

Please sign in to comment.