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