PLT-6689: fix user image requests (#6946)
* fix user image requests * fix eslint errors and a few more cache busters
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
23a59b03dd
Коммит
673f3a1144
@@ -1023,6 +1023,17 @@ export function displayUsernameForUser(user) {
|
||||
return '';
|
||||
}
|
||||
|
||||
export function imageURLForUser(userIdOrObject) {
|
||||
if (typeof userIdOrObject == 'string') {
|
||||
const profile = UserStore.getProfile(userIdOrObject);
|
||||
if (profile) {
|
||||
return imageURLForUser(profile);
|
||||
}
|
||||
return Client4.getUsersRoute() + '/' + userIdOrObject + '/image?_=' + Date.now();
|
||||
}
|
||||
return Client4.getUsersRoute() + '/' + userIdOrObject.id + '/image?_=' + (userIdOrObject.last_picture_update || 0);
|
||||
}
|
||||
|
||||
// Converts a file size in bytes into a human-readable string of the form '123MB'.
|
||||
export function fileSizeToString(bytes) {
|
||||
// it's unlikely that we'll have files bigger than this
|
||||
|
||||
Ссылка в новой задаче
Block a user