fix fork menu allowing user to double select an entry (#6430)
in cases where forking a session was not immediate due to extensions slowing down teardown, it's possible for the user to select the message to fork more than once and then create multiple session forks. in this fix we close the forking menu before starting the fork process to not allow such behavior. fixes #6321
This commit is contained in:
@@ -4493,19 +4493,17 @@ export class InteractiveMode {
|
||||
const selector = new UserMessageSelectorComponent(
|
||||
userMessages.map((m) => ({ id: m.entryId, text: m.text })),
|
||||
async (entryId) => {
|
||||
done();
|
||||
try {
|
||||
const result = await this.runtimeHost.fork(entryId);
|
||||
if (result.cancelled) {
|
||||
done();
|
||||
this.ui.requestRender();
|
||||
return;
|
||||
}
|
||||
|
||||
this.editor.setText(result.selectedText ?? "");
|
||||
done();
|
||||
this.showStatus("Forked to new session");
|
||||
} catch (error: unknown) {
|
||||
done();
|
||||
this.showError(error instanceof Error ? error.message : String(error));
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user