mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-08-17 20:33:40 +00:00
confirmation dialogue
This commit is contained in:
parent
c9c1f69b82
commit
ca18942bfd
1 changed files with 14 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import { deleteSession, loadMessages } from "./session-api"
|
|||
import { showToastNotification } from "../lib/notifications"
|
||||
import { messageStoreBus } from "./message-v2/bus"
|
||||
import { instances } from "./instances"
|
||||
import { showConfirmDialog } from "./alerts"
|
||||
|
||||
export interface SessionInfo {
|
||||
cost: number
|
||||
|
|
@ -288,6 +289,19 @@ async function cleanupBlankSessions(instanceId: string, excludeSessionId?: strin
|
|||
const instanceSessions = sessions().get(instanceId)
|
||||
if (!instanceSessions) return
|
||||
|
||||
if (fetchIfNeeded) {
|
||||
const confirmed = await showConfirmDialog(
|
||||
"This cleanup may be slow, and may delete sessions you didn't intend to delete. Are you sure?",
|
||||
{
|
||||
title: "Deep Clean Sessions",
|
||||
detail: "Deep cleaning sessions fetches the messages for each and every session in your history so it can remove not just all blank sessions, but all unused forks of sessions, and all subagents whose primary task has been completed.",
|
||||
confirmLabel: "Continue",
|
||||
cancelLabel: "Cancel"
|
||||
}
|
||||
)
|
||||
if (!confirmed) return
|
||||
}
|
||||
|
||||
const cleanupPromises = Array.from(instanceSessions)
|
||||
.filter(([sessionId]) => sessionId !== excludeSessionId)
|
||||
.map(async ([sessionId, session]) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue