From 49f5d26e5e0e7167ddbda983148e68e253d7b5d7 Mon Sep 17 00:00:00 2001 From: Kalydosos Date: Thu, 12 Dec 2024 10:24:28 +0100 Subject: [PATCH] fix cors issue on attachments --- src/components/FullscreenLoadingIndicator.tsx | 6 +++--- src/components/Image/index.tsx | 4 ++-- src/components/ImageWithSizeCalculation.tsx | 11 +---------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/components/FullscreenLoadingIndicator.tsx b/src/components/FullscreenLoadingIndicator.tsx index eed51be7d328..4fa393789934 100644 --- a/src/components/FullscreenLoadingIndicator.tsx +++ b/src/components/FullscreenLoadingIndicator.tsx @@ -6,16 +6,16 @@ import useThemeStyles from '@hooks/useThemeStyles'; type FullScreenLoadingIndicatorProps = { style?: StyleProp; - _51888test?: boolean; + flag51888test?: boolean; }; -function FullScreenLoadingIndicator({style, _51888test}: FullScreenLoadingIndicatorProps) { +function FullScreenLoadingIndicator({style, flag51888test}: FullScreenLoadingIndicatorProps) { const theme = useTheme(); const styles = useThemeStyles(); return ( diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index 600810497bf5..222d558b6e60 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -64,7 +64,7 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object // most likely a reauthentication happens // but unless the calculated source is different from the previous, the image wont reload if (isAcceptedSession(session.creationDate - previousSessionAge.current, session.creationDate)) { - console.log( + Log.info( `@51888 setting validSessionAge to accepted session ${session.authToken?.substring(0, 10)} creationDate ${new Date( session.creationDate, ).toISOString()}} received less than 60s ago or newer from 2H`, @@ -146,7 +146,7 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object return undefined; } if (source === undefined) { - return ; + return ; } return ( { - //(typeof url === 'string' ? {uri: url} : url) - if (isAuthTokenRequired) { - Log.info(`@51888 ImageWitrhSize source ${url}`); - } - if (typeof url === 'string') { - return {uri: url}; - } - return url; - }, [url]); + const source = useMemo(() => (typeof url === 'string' ? {uri: url} : url), [url]); const onError = () => { Log.hmmm('Unable to fetch image to calculate size', {url});