Apply the auto-fixable lint rules and the formatter, and drop the Vite build artifacts.
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
import { JoinRule } from 'matrix-js-sdk';
|
||||
import { AvatarFallback, AvatarImage, color } from 'folds';
|
||||
import { Icon, Icons } from '../icons';
|
||||
import React, { ComponentProps, ReactEventHandler, ReactNode, forwardRef, useEffect, useState } from 'react';
|
||||
import React, {
|
||||
ComponentProps,
|
||||
ReactEventHandler,
|
||||
ReactNode,
|
||||
forwardRef,
|
||||
useEffect,
|
||||
useState,
|
||||
} from 'react';
|
||||
import { Blurhash } from 'react-blurhash';
|
||||
import { Icon, Icons } from '../icons';
|
||||
import * as css from './RoomAvatar.css';
|
||||
import { joinRuleToIconSrc } from '../../utils/room';
|
||||
import colorMXID from '../../../util/colorMXID';
|
||||
@@ -33,16 +40,17 @@ export function RoomAvatar({ roomId, src, alt, renderFallback }: RoomAvatarProps
|
||||
const dims = getMediaDimensions(src ?? '');
|
||||
const blobCached =
|
||||
!!src &&
|
||||
(!useAuthentication ||
|
||||
!isAuthenticatedMediaUrl(src) ||
|
||||
!!getCachedAuthenticatedMediaUrl(src));
|
||||
(!useAuthentication || !isAuthenticatedMediaUrl(src) || !!getCachedAuthenticatedMediaUrl(src));
|
||||
const [loaded, setLoaded] = useState(() => isAvatarCached(src) || blobCached);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
authenticatedSrc &&
|
||||
(isAvatarCached(src) ||
|
||||
(src && (!useAuthentication || !isAuthenticatedMediaUrl(src) || getCachedAuthenticatedMediaUrl(src))))
|
||||
(src &&
|
||||
(!useAuthentication ||
|
||||
!isAuthenticatedMediaUrl(src) ||
|
||||
getCachedAuthenticatedMediaUrl(src))))
|
||||
) {
|
||||
setLoaded(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user