mirror of
				https://github.com/abhinavxd/libredesk.git
				synced 2025-11-03 21:43:35 +00:00 
			
		
		
		
	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.
This commit is contained in:
		@@ -10,7 +10,7 @@
 | 
				
			|||||||
      <CommandGroup
 | 
					      <CommandGroup
 | 
				
			||||||
        heading="Conversations"
 | 
					        heading="Conversations"
 | 
				
			||||||
        value="conversations"
 | 
					        value="conversations"
 | 
				
			||||||
        v-if="nestedCommand === null && conversationStore.current"
 | 
					        v-if="nestedCommand === null && conversationStore.hasConversationOpen"
 | 
				
			||||||
      >
 | 
					      >
 | 
				
			||||||
        <CommandItem value="conv-snooze" @select="setNestedCommand('snooze')"> Snooze </CommandItem>
 | 
					        <CommandItem value="conv-snooze" @select="setNestedCommand('snooze')"> Snooze </CommandItem>
 | 
				
			||||||
        <CommandItem value="conv-resolve" @select="resolveConversation"> Resolve </CommandItem>
 | 
					        <CommandItem value="conv-resolve" @select="resolveConversation"> Resolve </CommandItem>
 | 
				
			||||||
@@ -45,7 +45,6 @@
 | 
				
			|||||||
                  :data-index="index"
 | 
					                  :data-index="index"
 | 
				
			||||||
                  @select="handleApplyMacro(macro)"
 | 
					                  @select="handleApplyMacro(macro)"
 | 
				
			||||||
                  class="px-3 py-2 rounded-md cursor-pointer transition-all duration-200 hover:bg-primary/10 hover:text-primary"
 | 
					                  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 }"
 | 
					 | 
				
			||||||
                >
 | 
					                >
 | 
				
			||||||
                  <div class="flex items-center space-x-2 justify-start">
 | 
					                  <div class="flex items-center space-x-2 justify-start">
 | 
				
			||||||
                    <Zap :size="14" class="text-primary" />
 | 
					                    <Zap :size="14" class="text-primary" />
 | 
				
			||||||
@@ -219,7 +218,9 @@ watch([Meta_K, Ctrl_K], ([mac, win]) => {
 | 
				
			|||||||
const highlightedMacro = ref(null)
 | 
					const highlightedMacro = ref(null)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function handleApplyMacro(macro) {
 | 
					function handleApplyMacro(macro) {
 | 
				
			||||||
  conversationStore.setMacro(macro)
 | 
					  // Create a deep copy.
 | 
				
			||||||
 | 
					  const plainMacro = JSON.parse(JSON.stringify(macro))
 | 
				
			||||||
 | 
					  conversationStore.setMacro(plainMacro)
 | 
				
			||||||
  handleOpenChange()
 | 
					  handleOpenChange()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user