Skip to content

Commit

Permalink
fix: avatar exhaustion issue in AssistantBuilder (#2491)
Browse files Browse the repository at this point in the history
component
  • Loading branch information
fontanierh authored Nov 10, 2023
1 parent da7a0ee commit 9f14dc3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion front/components/assistant_builder/AssistantBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,17 @@ export default function AssistantBuilder({
.map((a) => a.pictureUrl.split(DROID_AVATARS_BASE_PATH)[1])
.filter(Boolean)
);
const availableUrls = DROID_AVATAR_FILES.filter(
let availableUrls = DROID_AVATAR_FILES.filter(
(f) => !usedAvatarFiles.has(f)
).map((f) => `https://dust.tt/${DROID_AVATARS_BASE_PATH}${f}`);

// TODO(@fontanierh): figure out a real solution for avatar exhaustion
if (!availableUrls.length) {
availableUrls = DROID_AVATAR_FILES.map(
(f) => `https://dust.tt/${DROID_AVATARS_BASE_PATH}${f}`
);
}

setAvatarUrls(
DROID_AVATAR_FILES.map((f) => ({
url: `https://dust.tt/${DROID_AVATARS_BASE_PATH}${f}`,
Expand Down

0 comments on commit 9f14dc3

Please sign in to comment.