Skip to content

Commit

Permalink
Use longer variable name: event
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciejSWM committed Mar 13, 2024
1 parent a66039e commit 6d15c3d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/components/OnboardingWelcomeVideo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,15 @@ function OnboardingWelcomeVideo() {
Navigation.goBack();
}, []);

const setAspectRatio = (e: VideoReadyForDisplayEvent | VideoLoadedEventType | undefined) => {
if (!e) {
const setAspectRatio = (event: VideoReadyForDisplayEvent | VideoLoadedEventType | undefined) => {
if (!event) {
return;
}

// TODO: Figure out why on mobile there's e.naturalSize and on web it's e.srcElement
if ('naturalSize' in e) {
setVideoAspectRatio(e.naturalSize.width / e.naturalSize.height);
if ('naturalSize' in event) {
setVideoAspectRatio(event.naturalSize.width / event.naturalSize.height);
} else {
setVideoAspectRatio(e.srcElement.videoWidth / e.srcElement.videoHeight);
setVideoAspectRatio(event.srcElement.videoWidth / event.srcElement.videoHeight);
}
};

Expand Down

0 comments on commit 6d15c3d

Please sign in to comment.