mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
Close dialog before async operations to prevent input capture
This commit is contained in:
@@ -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],
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user