mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
* improved chat row first pass * big UI improvements * working functionality * tests working * ok finally tests working for real! * translations * add back hidden flag * remove option to skip notif * fixed image issue * ui fix * put back edit flag * oops test fix * reduce margins * code review
17 lines
598 B
TypeScript
17 lines
598 B
TypeScript
/**
|
|
* Utility function to append new images to existing images array
|
|
* while respecting the maximum image limit
|
|
*
|
|
* @param currentImages - The current array of images
|
|
* @param newImages - The new images to append
|
|
* @param maxImages - The maximum number of images allowed
|
|
* @returns The updated images array
|
|
*/
|
|
export function appendImages(currentImages: string[], newImages: string[] | undefined, maxImages: number): string[] {
|
|
const imagesToAdd = newImages ?? []
|
|
if (imagesToAdd.length === 0) {
|
|
return currentImages
|
|
}
|
|
|
|
return [...currentImages, ...imagesToAdd].slice(0, maxImages)
|
|
}
|