File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 44	import  Input  from  ' $lib/components/ui/input/input.svelte'  
55	import  { Trash2 , Pencil , MoreHorizontal  } from  ' @lucide/svelte'  
66	import  { KeyboardShortcutInfo  } from  ' $lib/components/app'  
7+ 	import  { onMount  } from  ' svelte'  
78
89	interface  Props  { 
910		isActive? :  boolean ; 
6061		onSelect ?.(conversation .id ); 
6162	} 
6263
63- 	//  Listen for global edit event 
6464	function  handleGlobalEditEvent(event :  Event ) { 
6565		const =  event  as  CustomEvent <{ conversationId:  string  }>; 
6666		if  (customEvent .detail .conversationId  ===  conversation .id  &&  isActive ) { 
6767			handleEdit (event ); 
6868		} 
6969	} 
7070
71- 	//  Add event listener when component mounts 
72- 	$effect (() =>  { 
71+ 	onMount (() =>  { 
7372		document .addEventListener (' edit-active-conversation' handleGlobalEditEvent  as  EventListener ); 
7473
7574		return  () =>  { 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments