Skip to content

Commit 449d83b

Browse files
committed
Adds prefix optoin for avatar uri
1 parent 952cd00 commit 449d83b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

general.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,12 @@ export function objectIsEmpty(obj: any): boolean {
186186
return true;
187187
}
188188

189-
export function getUserAvatarUri(user) {
189+
export function getUserAvatarUri(user, prefix?: string) {
190190
let avatarId = 0;
191191
if (user && user.firstName && user.lastName) {
192192
avatarId = (user.firstName[0].charCodeAt(0) + user.lastName[0].charCodeAt(0)) % 5;
193193
}
194+
if (prefix) return prefix + avatarId + ".png";
194195
return avatarId + ".png";
195196
}
196197

0 commit comments

Comments
 (0)