Close dialog before async operations to prevent input capture

This commit is contained in:
Alexander Farber
2025-12-13 12:13:33 +01:00
parent e76f47512c
commit 1098c23b26

View File

@@ -442,7 +442,12 @@ export const AppContainer = (props: AppContainerProps) => {
// Handle resume session selection // Handle resume session selection
const handleResumeSessionSelect = useCallback( const handleResumeSessionSelect = useCallback(
async (sessionId: string) => { async (sessionId: string) => {
if (!config) return; if (!config) {
return;
}
// Close dialog immediately to prevent input capture during async operations
closeResumeDialog();
const { const {
SessionService, SessionService,
@@ -459,7 +464,6 @@ export const AppContainer = (props: AppContainerProps) => {
const sessionData = await sessionService.loadSession(sessionId); const sessionData = await sessionService.loadSession(sessionId);
if (!sessionData) { if (!sessionData) {
closeResumeDialog();
return; return;
} }
@@ -486,8 +490,6 @@ export const AppContainer = (props: AppContainerProps) => {
// Clear and load history // Clear and load history
historyManager.clearItems(); historyManager.clearItems();
historyManager.loadHistory(uiHistoryItems); historyManager.loadHistory(uiHistoryItems);
closeResumeDialog();
}, },
[config, closeResumeDialog, historyManager, startNewSession], [config, closeResumeDialog, historyManager, startNewSession],
); );