forked from open-webui/open-webui
		
	add isFirstMessage prop to UserMessage component
This commit is contained in:
		
							parent
							
								
									c3ed6fe974
								
							
						
					
					
						commit
						32c7971300
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		|  | @ -239,6 +239,7 @@ | ||||||
| 							<UserMessage | 							<UserMessage | ||||||
| 								user={$user} | 								user={$user} | ||||||
| 								{message} | 								{message} | ||||||
|  | 								isFirstMessage={messageIdx === 0} | ||||||
| 								siblings={message.parentId !== null | 								siblings={message.parentId !== null | ||||||
| 									? history.messages[message.parentId]?.childrenIds ?? [] | 									? history.messages[message.parentId]?.childrenIds ?? [] | ||||||
| 									: Object.values(history.messages) | 									: Object.values(history.messages) | ||||||
|  |  | ||||||
|  | @ -9,6 +9,7 @@ | ||||||
| 	export let user; | 	export let user; | ||||||
| 	export let message; | 	export let message; | ||||||
| 	export let siblings; | 	export let siblings; | ||||||
|  | 	export let isFirstMessage: boolean; | ||||||
| 
 | 
 | ||||||
| 	export let confirmEditMessage: Function; | 	export let confirmEditMessage: Function; | ||||||
| 	export let showPreviousMessage: Function; | 	export let showPreviousMessage: Function; | ||||||
|  | @ -282,11 +283,11 @@ | ||||||
| 							</svg> | 							</svg> | ||||||
| 						</button> | 						</button> | ||||||
| 
 | 
 | ||||||
| 						<!-- {#if not first message } | 						{#if !isFirstMessage} | ||||||
| 						<button | 						<button | ||||||
| 							class="invisible group-hover:visible p-1 rounded dark:hover:text-white transition" | 							class="invisible group-hover:visible p-1 rounded dark:hover:text-white transition" | ||||||
| 							on:click={() => { | 							on:click={() => { | ||||||
| 								// delete message | 								// TODO delete message | ||||||
| 							}} | 							}} | ||||||
| 						> | 						> | ||||||
| 							<svg | 							<svg | ||||||
|  | @ -304,7 +305,7 @@ | ||||||
| 								/> | 								/> | ||||||
| 							</svg> | 							</svg> | ||||||
| 						</button> | 						</button> | ||||||
| 						{/if} --> | 						{/if}  | ||||||
| 					</div> | 					</div> | ||||||
| 				</div> | 				</div> | ||||||
| 			{/if} | 			{/if} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Danny Liu
						Danny Liu