Dialog fixes

This commit is contained in:
Tickbase
2025-05-18 10:37:53 +02:00
parent 3a8dccf7f8
commit f5abcfdb6d
3 changed files with 11 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ function App() {
const {
dlcDialog,
handleDlcDialogClose,
handleProgressDialogClose,
progressDialog,
handleGameAction,
handleDlcConfirm,
@@ -91,7 +92,7 @@ function App() {
progress={progressDialog.progress}
showInstructions={progressDialog.showInstructions}
instructions={progressDialog.instructions}
onClose={() => {}}
onClose={handleProgressDialogClose}
/>
{/* DLC Selection Dialog */}

View File

@@ -37,6 +37,7 @@ export interface AppContextType {
isLoading: boolean;
error: string | null;
loadGames: () => Promise<boolean>;
handleProgressDialogClose: () => void;
// DLC management
dlcDialog: DlcDialogState;

View File

@@ -33,6 +33,7 @@ export const AppProvider = ({ children }: AppProviderProps) => {
const {
progressDialog,
handleCloseProgressDialog,
handleGameAction: executeGameAction,
handleDlcConfirm: executeDlcConfirm,
} = useGameActions()
@@ -55,8 +56,7 @@ export const AppProvider = ({ children }: AppProviderProps) => {
}
try {
await streamGameDlcs(gameId)
// Open the dialog
setDlcDialog({
...dlcDialog,
visible: true,
@@ -64,8 +64,12 @@ export const AppProvider = ({ children }: AppProviderProps) => {
gameTitle: game.title,
isLoading: true,
isEditMode: true,
dlcs: [], // start empty
progress: 0,
})
// Now fetch DLCs in the background
streamGameDlcs(gameId)
} catch (error) {
showError(`Failed to load DLCs: ${error}`)
}
@@ -157,6 +161,7 @@ export const AppProvider = ({ children }: AppProviderProps) => {
progressDialog,
handleGameAction,
handleDlcConfirm,
handleProgressDialogClose: handleCloseProgressDialog,
// Toast notifications
showToast,