From 873d26ccb23080d7b8a8a2712e23f7ffc6e6fc6a Mon Sep 17 00:00:00 2001 From: Abhinav Raut Date: Wed, 26 Feb 2025 23:19:37 +0530 Subject: [PATCH] fix: ensure deep copy of macros, as removing macro from editor was deleting the macro action from the macro store. - fix: conversation macro cmds visible when conversation is not open. --- frontend/src/features/command/CommandBox.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/features/command/CommandBox.vue b/frontend/src/features/command/CommandBox.vue index 1a9adff..86de3c3 100644 --- a/frontend/src/features/command/CommandBox.vue +++ b/frontend/src/features/command/CommandBox.vue @@ -10,7 +10,7 @@ Snooze Resolve @@ -45,7 +45,6 @@ :data-index="index" @select="handleApplyMacro(macro)" class="px-3 py-2 rounded-md cursor-pointer transition-all duration-200 hover:bg-primary/10 hover:text-primary" - :class="{ 'bg-primary/5 text-primary': selectedMacroIndex === index }" >
@@ -219,7 +218,9 @@ watch([Meta_K, Ctrl_K], ([mac, win]) => { const highlightedMacro = ref(null) function handleApplyMacro(macro) { - conversationStore.setMacro(macro) + // Create a deep copy. + const plainMacro = JSON.parse(JSON.stringify(macro)) + conversationStore.setMacro(plainMacro) handleOpenChange() }