fix: toast on save success/failure, skip toast on print
This commit is contained in:
@@ -1529,6 +1529,7 @@ function addMessageToolbar(msgDiv) {
|
||||
saveBtn.innerHTML = '💾';
|
||||
saveBtn.title = 'Save as .md';
|
||||
saveBtn.onclick = () => {
|
||||
try {
|
||||
const t = getText();
|
||||
const blob = new Blob([t], { type: 'text/markdown' });
|
||||
const a = document.createElement('a');
|
||||
@@ -1536,6 +1537,8 @@ function addMessageToolbar(msgDiv) {
|
||||
a.download = `caic-response-${Date.now()}.md`;
|
||||
a.click();
|
||||
URL.revokeObjectURL(a.href);
|
||||
showToast('Saved');
|
||||
} catch(e) { showToast('Save failed'); }
|
||||
};
|
||||
toolbar.append(copyBtn, printBtn, saveBtn, sep());
|
||||
if (!msgDiv.classList.contains('search-result')) {
|
||||
|
||||
Reference in New Issue
Block a user