fix notifications for smokeapi install

This commit is contained in:
Novattz
2026-01-17 20:48:15 +01:00
parent 61ad3f1d54
commit 365063d30d

View File

@@ -34,8 +34,6 @@ export const AppProvider = ({ children }: AppProviderProps) => {
handleGameAction: executeGameAction, handleGameAction: executeGameAction,
handleDlcConfirm: executeDlcConfirm, handleDlcConfirm: executeDlcConfirm,
unlockerSelectionDialog, unlockerSelectionDialog,
handleSelectCreamLinux,
handleSelectSmokeAPI,
closeUnlockerDialog, closeUnlockerDialog,
} = useGameActions() } = useGameActions()
@@ -280,12 +278,26 @@ export const AppProvider = ({ children }: AppProviderProps) => {
if (gameId) { if (gameId) {
const game = games.find((g) => g.id === gameId) const game = games.find((g) => g.id === gameId)
if (game) { if (game) {
closeUnlockerDialog()
// Reset installing state before showing DLC dialog // Reset installing state before showing DLC dialog
setGames((prevGames) => setGames((prevGames) =>
prevGames.map((g) => (g.id === gameId ? { ...g, installing: false } : g)) prevGames.map((g) => (g.id === gameId ? { ...g, installing: false } : g))
) )
// Call the original handleSelectCreamLinux which will trigger install_cream // Show DLC selection dialog directly
handleSelectCreamLinux() setDlcDialog({
...dlcDialog,
visible: true,
gameId,
gameTitle: game.title,
dlcs: [],
isLoading: true,
isEditMode: false,
progress: 0,
})
streamGameDlcs(gameId)
} }
} }
}, },
@@ -293,9 +305,14 @@ export const AppProvider = ({ children }: AppProviderProps) => {
// When SmokeAPI is selected, trigger the actual installation // When SmokeAPI is selected, trigger the actual installation
const gameId = unlockerSelectionDialog.gameId const gameId = unlockerSelectionDialog.gameId
if (gameId) { if (gameId) {
// Close the dialog first const game = games.find((g) => g.id === gameId)
handleSelectSmokeAPI() if (game) {
// The selection callback will handle the actual installation closeUnlockerDialog()
setTimeout(() => {
handleGameAction(gameId, 'install_smoke')
}, 0)
}
} }
}, },
closeUnlockerDialog, closeUnlockerDialog,