memory dashboard - double toast fix

frdel committed Sep 30, 2025 at 11:26 UTC f09ea5b21eb8cc539d19276e2e823428f4e4f418
1 file changed +9 -7
webui/components/settings/memory/memory-dashboard-store.js
+9 -7
@@ -397,7 +397,7 @@ ${memory.content_full}
397 .map((memory) => this.formatMemoryForCopy(memory))
398 .join("\n");
399
400 - this.copyToClipboard(content);
400 + this.copyToClipboard(content, false);
401 justToast(
402 `Copied ${selectedMemories.length} memories with metadata to clipboard`,
403 "success"
@@ -516,23 +516,24 @@ ${memory.content_full}
516 return colors[area] || "#6c757d";
517 },
518
519 - copyToClipboard(text) {
519 + copyToClipboard(text, toastSuccess = true) {
520 if (navigator.clipboard && window.isSecureContext) {
521 navigator.clipboard
522 .writeText(text)
523 .then(() => {
524 - justToast("Copied to clipboard!", "success");
524 + if(toastSuccess)
525 + justToast("Copied to clipboard!", "success");
526 })
527 .catch((err) => {
528 console.error("Clipboard copy failed:", err);
528 - this.fallbackCopyToClipboard(text);
529 + this.fallbackCopyToClipboard(text, toastSuccess);
530 });
531 } else {
531 - this.fallbackCopyToClipboard(text);
532 + this.fallbackCopyToClipboard(text, toastSuccess);
533 }
534 },
535
535 - fallbackCopyToClipboard(text) {
536 + fallbackCopyToClipboard(text, toastSuccess = true) {
537 const textArea = document.createElement("textarea");
538 textArea.value = text;
539 textArea.style.position = "fixed";
@@ -543,7 +544,8 @@ ${memory.content_full}
544 textArea.select();
545 try {
546 document.execCommand("copy");
546 - justToast("Copied to clipboard!", "success");
547 + if(toastSuccess)
548 + justToast("Copied to clipboard!", "success");
549 } catch (err) {
550 console.error("Fallback clipboard copy failed:", err);
551 justToast("Failed to copy to clipboard", "error");