Sessions: confirm chat delete actions
- confirm sidebar/session-list chat deletes - confirm library chat menu deletes - confirm archived chat permanent deletes
This commit is contained in:
@@ -2059,6 +2059,7 @@ let _libraryArchivedView = false; // Documents tab showing archived docs?
|
||||
{ label: 'Copy', action: () => _copyChatById(s.id) },
|
||||
{ label: 'Archive', action: async () => { await fetch(API_BASE + '/api/session/' + s.id + '/archive', { method: 'POST', headers: {'Content-Type':'application/json'} }); _renderLibChats(); } },
|
||||
{ label: 'Delete', action: async () => {
|
||||
if (!await window.styledConfirm('Delete this chat?', { confirmText: 'Delete', danger: true })) return;
|
||||
await fetch(API_BASE + '/api/session/' + s.id, { method: 'DELETE' });
|
||||
card.style.maxHeight = `${Math.max(card.getBoundingClientRect().height, card.scrollHeight)}px`;
|
||||
card.classList.add('memory-tidy-removing');
|
||||
@@ -2412,7 +2413,11 @@ let _libraryArchivedView = false; // Documents tab showing archived docs?
|
||||
{ label: 'Open', action: () => { if (window.sessionModule) window.sessionModule.selectSession(s.id); } },
|
||||
{ label: 'Copy', action: () => _copyChatById(s.id) },
|
||||
{ label: 'Restore', action: async () => { await fetch(API_BASE + '/api/session/' + s.id + '/unarchive', { method: 'POST' }); _renderLibArchive(); } },
|
||||
{ label: 'Delete', action: async () => { await fetch(API_BASE + '/api/session/' + s.id, { method: 'DELETE' }); _renderLibArchive(); }, danger: true },
|
||||
{ label: 'Delete', action: async () => {
|
||||
if (!await window.styledConfirm('Delete this chat permanently?', { confirmText: 'Delete', danger: true })) return;
|
||||
await fetch(API_BASE + '/api/session/' + s.id, { method: 'DELETE' });
|
||||
_renderLibArchive();
|
||||
}, danger: true },
|
||||
], { onSelect: () => {
|
||||
_arcSelectMode = true;
|
||||
_arcSelected.add('chats:' + s.id);
|
||||
|
||||
Reference in New Issue
Block a user