mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-07-09 17:28:45 +00:00
fix fork menu allowing user to double select an entry (#6430)
Some checks are pending
CI / build-check-test (push) Waiting to run
Some checks are pending
CI / build-check-test (push) Waiting to run
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:
parent
dd1c690f36
commit
86afffe01f
1 changed files with 1 additions and 3 deletions
|
|
@ -4493,19 +4493,17 @@ export class InteractiveMode {
|
||||||
const selector = new UserMessageSelectorComponent(
|
const selector = new UserMessageSelectorComponent(
|
||||||
userMessages.map((m) => ({ id: m.entryId, text: m.text })),
|
userMessages.map((m) => ({ id: m.entryId, text: m.text })),
|
||||||
async (entryId) => {
|
async (entryId) => {
|
||||||
|
done();
|
||||||
try {
|
try {
|
||||||
const result = await this.runtimeHost.fork(entryId);
|
const result = await this.runtimeHost.fork(entryId);
|
||||||
if (result.cancelled) {
|
if (result.cancelled) {
|
||||||
done();
|
|
||||||
this.ui.requestRender();
|
this.ui.requestRender();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.editor.setText(result.selectedText ?? "");
|
this.editor.setText(result.selectedText ?? "");
|
||||||
done();
|
|
||||||
this.showStatus("Forked to new session");
|
this.showStatus("Forked to new session");
|
||||||
} catch (error: unknown) {
|
} catch (error: unknown) {
|
||||||
done();
|
|
||||||
this.showError(error instanceof Error ? error.message : String(error));
|
this.showError(error instanceof Error ? error.message : String(error));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue