Skip to content

Commit

Permalink
fix cors issue on attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalydosos committed Dec 12, 2024
1 parent f8f4173 commit 49f5d26
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/components/FullscreenLoadingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import useThemeStyles from '@hooks/useThemeStyles';

type FullScreenLoadingIndicatorProps = {
style?: StyleProp<ViewStyle>;
_51888test?: boolean;
flag51888test?: boolean;
};

function FullScreenLoadingIndicator({style, _51888test}: FullScreenLoadingIndicatorProps) {
function FullScreenLoadingIndicator({style, flag51888test}: FullScreenLoadingIndicatorProps) {
const theme = useTheme();
const styles = useThemeStyles();
return (
<View style={[StyleSheet.absoluteFillObject, styles.fullScreenLoading, style]}>
<ActivityIndicator
color={_51888test ? theme.textError : theme.spinner}
color={flag51888test ? theme.textError : theme.spinner}
size="large"
/>
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down Expand Up @@ -146,7 +146,7 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object
return undefined;
}
if (source === undefined) {
return <FullScreenLoadingIndicator _51888test={true} />;
return <FullScreenLoadingIndicator flag51888test />;
}
return (
<BaseImage
Expand Down
11 changes: 1 addition & 10 deletions src/components/ImageWithSizeCalculation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,7 @@ function ImageWithSizeCalculation({url, altText, style, onMeasure, onLoadFailure
const [isLoading, setIsLoading] = useState(false);
const {isOffline} = useNetwork();

const source = useMemo(() => {
//(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});
Expand Down

0 comments on commit 49f5d26

Please sign in to comment.