From f6ae4e833fc52a586aba3be67ce5be4e58db158c Mon Sep 17 00:00:00 2001 From: Kalydosos Date: Sun, 8 Dec 2024 18:40:25 +0100 Subject: [PATCH] fix cors issues --- src/components/Image/index.tsx | 7 +++---- src/components/Image/types.ts | 2 -- src/libs/actions/Session/Reauthenticator.ts | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index 13d198de4675..4cd8cd20ed5f 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -12,7 +12,6 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object const [aspectRatio, setAspectRatio] = useState(null); const isObjectPositionTop = objectPosition === CONST.IMAGE_OBJECT_POSITION.TOP; const session = useSession(); - let displayActivityIndicator = false; const {shouldSetAspectRatioInStyle} = useContext(ImageBehaviorContext); @@ -71,11 +70,12 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object return session.creationDate; } return undefined; - }, [session]); + }, [session, isAuthTokenRequired, isAcceptedSession]); useEffect(() => { if (isAuthTokenRequired) { previousSessionAge.current = validSessionAge; } + return; }); /** @@ -103,7 +103,6 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object if (session) { activateReauthenticator(session); } - displayActivityIndicator = true; // eslint-disable-next-line @typescript-eslint/no-unsafe-return return undefined; } @@ -120,7 +119,7 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object */ const shouldOpacityBeZero = isObjectPositionTop && !aspectRatio; - return displayActivityIndicator ? ( + return source === undefined ? ( ) : (