Skip to content

Commit 07b49e1

Browse files
committed
fix: adjust avatar selection logic to ensure consistent image indexing
1 parent e2fe117 commit 07b49e1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/utils/getAvatarVisualNumber.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ export function getAvatarVisualNumber({
1111
const sum = digitGroups.reduce((accu, current) => {
1212
return accu + Number(current);
1313
}, 0);
14-
const chosenImageIndex = sum % 14;
15-
if (chosenImageIndex === 0) {
16-
return 'profile-avatar-bg-1';
17-
}
14+
const chosenImageIndex = (sum % 13) + 1;
1815
return `profile-avatar-bg-${chosenImageIndex}`;
1916
}

0 commit comments

Comments
 (0)