Skip to content

Commit f9035e2

Browse files
vid277cdxker
authored andcommitted
feature: allow editing images through pdp chat
1 parent 6c04ed9 commit f9035e2

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

clients/search-component/src/utils/hooks/chat-context.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,25 @@ function ChatProvider({ children }: { children: React.ReactNode }) {
11141114
return false;
11151115
};
11161116

1117-
if (referenceImageUrls.length > 0) {
1117+
if (referenceImageUrls.length > 0 || curGroup) {
1118+
if (referenceImageUrls.length == 0 && curGroup) {
1119+
const chunksInGroupPromise = await trieveSDK.getChunksInGroup(
1120+
{
1121+
groupId: curGroup.id,
1122+
page: 1,
1123+
},
1124+
searchAbortController.current.signal,
1125+
);
1126+
1127+
if (chunksInGroupPromise.chunks[0].image_urls) {
1128+
chunksInGroupPromise.chunks[0].image_urls.forEach((url) => {
1129+
referenceImageUrls.push(url ?? "");
1130+
});
1131+
}
1132+
1133+
referenceImageUrls.slice(0, 5);
1134+
}
1135+
11181136
if (await handleImageEdit()) {
11191137
return;
11201138
}

0 commit comments

Comments
 (0)