bits and bob

This commit is contained in:
Tickbase
2025-05-18 17:57:36 +02:00
parent 4b70cec6e9
commit 79fd51c5e5
20 changed files with 173 additions and 55 deletions

View File

@@ -107,15 +107,25 @@ export const AppProvider = ({ children }: AppProviderProps) => {
// DLC confirmation wrapper
const handleDlcConfirm = (selectedDlcs: DlcInfo[]) => {
closeDlcDialog()
const { gameId, isEditMode } = dlcDialog
// MODIFIED: Create a deep copy to ensure we don't have reference issues
const dlcsCopy = selectedDlcs.map(dlc => ({...dlc}))
// Log detailed info before closing dialog
console.log(`Saving ${dlcsCopy.filter(d => d.enabled).length} enabled and ${
dlcsCopy.length - dlcsCopy.filter(d => d.enabled).length
} disabled DLCs`)
// Close dialog FIRST to avoid UI state issues
closeDlcDialog()
// Update game state to show it's installing
setGames(prevGames =>
prevGames.map(g => g.id === gameId ? { ...g, installing: true } : g)
)
executeDlcConfirm(selectedDlcs, gameId, isEditMode, games)
executeDlcConfirm(dlcsCopy, gameId, isEditMode, games)
.then(() => {
success(isEditMode
? "DLC configuration updated successfully"