diff --git a/ui/src/ui/app-render.ts b/ui/src/ui/app-render.ts index e950e93be..d444cfd21 100644 --- a/ui/src/ui/app-render.ts +++ b/ui/src/ui/app-render.ts @@ -497,13 +497,12 @@ export function renderApp(state: AppViewState) { onSplitRatioChange: (ratio: number) => state.handleSplitRatioChange(ratio), assistantName: state.assistantName, assistantAvatar: state.assistantAvatar, - // Delete session (hidden for main session) + // Delete session (disabled for main session) showDeleteConfirm: state.chatDeleteConfirm, - onDeleteClick: + isMainSession: state.sessionKey === "main" || - parseAgentSessionKey(state.sessionKey)?.rest === "main" - ? undefined - : () => (state.chatDeleteConfirm = true), + parseAgentSessionKey(state.sessionKey)?.rest === "main", + onDeleteClick: () => (state.chatDeleteConfirm = true), onDeleteConfirm: async () => { state.chatDeleteConfirm = false; const { deleteSession } = await import("./controllers/sessions"); diff --git a/ui/src/ui/views/chat.ts b/ui/src/ui/views/chat.ts index 31beb8541..c7c8b38aa 100644 --- a/ui/src/ui/views/chat.ts +++ b/ui/src/ui/views/chat.ts @@ -70,6 +70,7 @@ export type ChatProps = { onChatScroll?: (event: Event) => void; // Delete session showDeleteConfirm?: boolean; + isMainSession?: boolean; onDeleteClick?: () => void; onDeleteConfirm?: () => void; onDeleteCancel?: () => void; @@ -407,9 +408,9 @@ export function renderChat(props: ChatProps) { ? html`