Skip to content

Commit

Permalink
fix cors issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalydosos committed Dec 8, 2024
1 parent 9f29282 commit f6ae4e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions src/components/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object
const [aspectRatio, setAspectRatio] = useState<string | number | null>(null);
const isObjectPositionTop = objectPosition === CONST.IMAGE_OBJECT_POSITION.TOP;
const session = useSession();
let displayActivityIndicator = false;

const {shouldSetAspectRatioInStyle} = useContext(ImageBehaviorContext);

Expand Down Expand Up @@ -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;

Check failure on line 78 in src/components/Image/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint check

Unnecessary return statement

Check failure on line 78 in src/components/Image/index.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unnecessary return statement
});

/**
Expand Down Expand Up @@ -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;
}
Expand All @@ -120,7 +119,7 @@ function Image({source: propsSource, isAuthTokenRequired = false, onLoad, object
*/
const shouldOpacityBeZero = isObjectPositionTop && !aspectRatio;

return displayActivityIndicator ? (
return source === undefined ? (
<FullScreenLoadingIndicator />
) : (
<BaseImage
Expand Down
2 changes: 0 additions & 2 deletions src/components/Image/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type {ImageSource} from 'expo-image';
import type {ImageRequireSource, ImageResizeMode, ImageStyle, ImageURISource, StyleProp} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import type CONST from '@src/CONST';
import type {Session} from '@src/types/onyx';

type ExpoImageSource = ImageSource | number | ImageSource[];

Expand Down
3 changes: 2 additions & 1 deletion src/libs/actions/Session/Reauthenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Onyx.connect({
deactivate();
}
}
return;

Check failure on line 32 in src/libs/actions/Session/Reauthenticator.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Unnecessary return statement

Check failure on line 32 in src/libs/actions/Session/Reauthenticator.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unnecessary return statement
},
});

Expand Down Expand Up @@ -61,8 +62,8 @@ function activate(session: Session) {
function tryReauthenticate() {
if (!isOffline && active) {
reauthenticate();
return;
}
return;

Check failure on line 66 in src/libs/actions/Session/Reauthenticator.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Unnecessary return statement

Check failure on line 66 in src/libs/actions/Session/Reauthenticator.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Unnecessary return statement
}

export {activate};

Check failure on line 69 in src/libs/actions/Session/Reauthenticator.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Prefer default export on a file with single export

Check failure on line 69 in src/libs/actions/Session/Reauthenticator.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Prefer default export on a file with single export

0 comments on commit f6ae4e8

Please sign in to comment.