@@ -625,15 +625,16 @@ class ChatStore {
625625
626626			const  allMessages  =  await  DatabaseStore . getConversationMessages ( this . activeConversation . id ) ; 
627627			const  rootMessage  =  allMessages . find ( ( m )  =>  m . type  ===  'root'  &&  m . parent  ===  null ) ; 
628- 			const  isFirstUserMessage  =  rootMessage  &&  messageToUpdate . parent  ===  rootMessage . id  &&  messageToUpdate . role  ===  'user' ; 
628+ 			const  isFirstUserMessage  = 
629+ 				rootMessage  &&  messageToUpdate . parent  ===  rootMessage . id  &&  messageToUpdate . role  ===  'user' ; 
629630
630631			this . updateMessageAtIndex ( messageIndex ,  {  content : newContent  } ) ; 
631632			await  DatabaseStore . updateMessage ( messageId ,  {  content : newContent  } ) ; 
632633
633634			// If this is the first user message, update the conversation title with confirmation if needed 
634635			if  ( isFirstUserMessage  &&  newContent . trim ( ) )  { 
635636				await  this . updateConversationTitleWithConfirmation ( 
636- 					this . activeConversation . id ,   
637+ 					this . activeConversation . id , 
637638					newContent . trim ( ) , 
638639					this . titleUpdateConfirmationCallback 
639640				) ; 
@@ -739,7 +740,6 @@ class ChatStore {
739740		} 
740741	} 
741742
742- 
743743	/** 
744744	 * Updates the name of a conversation 
745745	 * @param  convId - The conversation ID to update 
@@ -781,7 +781,7 @@ class ChatStore {
781781	 * @returns  Promise<boolean> - True if title was updated, false if cancelled 
782782	 */ 
783783	async  updateConversationTitleWithConfirmation ( 
784- 		convId : string ,   
784+ 		convId : string , 
785785		newTitle : string , 
786786		onConfirmationNeeded ?: ( currentTitle : string ,  newTitle : string )  =>  Promise < boolean > 
787787	) : Promise < boolean >  { 
@@ -986,18 +986,20 @@ class ChatStore {
986986			const  newFirstUserMessage  =  this . activeMessages . find ( 
987987				( m )  =>  m . role  ===  'user'  &&  m . parent  ===  rootMessage . id 
988988			) ; 
989- 			 
989+ 
990990			// Only show dialog if: 
991991			// 1. We have a new first user message 
992992			// 2. It's different from the previous one (different ID or content) 
993993			// 3. The new message has content 
994- 			if  ( newFirstUserMessage  &&  
994+ 			if  ( 
995+ 				newFirstUserMessage  && 
995996				newFirstUserMessage . content . trim ( )  && 
996- 				( ! currentFirstUserMessage  ||  
997- 				 newFirstUserMessage . id  !==  currentFirstUserMessage . id  || 
998- 				 newFirstUserMessage . content . trim ( )  !==  currentFirstUserMessage . content . trim ( ) ) )  { 
997+ 				( ! currentFirstUserMessage  || 
998+ 					newFirstUserMessage . id  !==  currentFirstUserMessage . id  || 
999+ 					newFirstUserMessage . content . trim ( )  !==  currentFirstUserMessage . content . trim ( ) ) 
1000+ 			)  { 
9991001				await  this . updateConversationTitleWithConfirmation ( 
1000- 					this . activeConversation . id ,   
1002+ 					this . activeConversation . id , 
10011003					newFirstUserMessage . content . trim ( ) , 
10021004					this . titleUpdateConfirmationCallback 
10031005				) ; 
@@ -1029,7 +1031,8 @@ class ChatStore {
10291031			// First user message is one that has the root message as its parent 
10301032			const  allMessages  =  await  DatabaseStore . getConversationMessages ( this . activeConversation . id ) ; 
10311033			const  rootMessage  =  allMessages . find ( ( m )  =>  m . type  ===  'root'  &&  m . parent  ===  null ) ; 
1032- 			const  isFirstUserMessage  =  rootMessage  &&  messageToEdit . parent  ===  rootMessage . id  &&  messageToEdit . role  ===  'user' ; 
1034+ 			const  isFirstUserMessage  = 
1035+ 				rootMessage  &&  messageToEdit . parent  ===  rootMessage . id  &&  messageToEdit . role  ===  'user' ; 
10331036
10341037			let  parentId  =  messageToEdit . parent ; 
10351038
@@ -1064,7 +1067,7 @@ class ChatStore {
10641067			// If this is the first user message, update the conversation title with confirmation if needed 
10651068			if  ( isFirstUserMessage  &&  newContent . trim ( ) )  { 
10661069				await  this . updateConversationTitleWithConfirmation ( 
1067- 					this . activeConversation . id ,   
1070+ 					this . activeConversation . id , 
10681071					newContent . trim ( ) , 
10691072					this . titleUpdateConfirmationCallback 
10701073				) ; 
@@ -1218,7 +1221,8 @@ export const regenerateMessageWithBranching =
12181221export  const  deleteMessage  =  chatStore . deleteMessage . bind ( chatStore ) ; 
12191222export  const  getDeletionInfo  =  chatStore . getDeletionInfo . bind ( chatStore ) ; 
12201223export  const  updateConversationName  =  chatStore . updateConversationName . bind ( chatStore ) ; 
1221- export  const  setTitleUpdateConfirmationCallback  =  chatStore . setTitleUpdateConfirmationCallback . bind ( chatStore ) ; 
1224+ export  const  setTitleUpdateConfirmationCallback  = 
1225+ 	chatStore . setTitleUpdateConfirmationCallback . bind ( chatStore ) ; 
12221226
12231227export  function  stopGeneration ( )  { 
12241228	chatStore . stopGeneration ( ) ; 
0 commit comments