Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix - fixes reset settings menu items that weren't hooked up in SwiftUI #2362

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading