| 65 | } |
| 66 | |
| 67 | export async function unrevert(input: { sessionID: string }) { |
| 68 | log.info("unreverting", input) |
| 69 | SessionPrompt.assertNotBusy(input.sessionID) |
| 70 | const session = await Session.get(input.sessionID) |
| 71 | if (!session.revert) return session |
| 72 | if (session.revert.snapshot) await Snapshot.restore(session.revert.snapshot) |
| 73 | const next = await Session.update(input.sessionID, (draft) => { |
| 74 | draft.revert = undefined |
| 75 | }) |
| 76 | return next |
| 77 | } |
| 78 | |
| 79 | export async function cleanup(session: Session.Info) { |
| 80 | if (!session.revert) return |