fix(tui): abort in-progress generation on undo (#4744)
This commit is contained in:
parent
e8ac4a1e99
commit
64caeeb12d
1 changed files with 3 additions and 1 deletions
|
|
@ -319,7 +319,9 @@ export function Session() {
|
|||
value: "session.undo",
|
||||
keybind: "messages_undo",
|
||||
category: "Session",
|
||||
onSelect: (dialog) => {
|
||||
onSelect: async (dialog) => {
|
||||
const status = sync.data.session_status[route.sessionID]
|
||||
if (status?.type !== "idle") await sdk.client.session.abort({ path: { id: route.sessionID } }).catch(() => {})
|
||||
const revert = session().revert?.messageID
|
||||
const message = messages().findLast((x) => (!revert || x.id < revert) && x.role === "user")
|
||||
if (!message) return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue