Skip to content

Commit

Permalink
fix type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
serhii1030 committed Apr 29, 2024
1 parent 50b3cb4 commit 9415778
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type {AVPlaybackSourceObject} from 'expo-av';
import React, {useCallback, useContext, useMemo, useRef, useState} from 'react';
import * as Expensicons from '@components/Icon/Expensicons';
import type {PopoverMenuItem} from '@components/PopoverMenu';
Expand Down Expand Up @@ -34,7 +33,11 @@ function VideoPopoverMenuContextProvider({children}: ChildrenProps) {
if (videoPopoverMenuPlayerRef.current === null) {
return;
}
const sourceURI = addEncryptedAuthTokenToURL((videoPopoverMenuPlayerRef.current.props.source as AVPlaybackSourceObject).uri);
const {source} = videoPopoverMenuPlayerRef.current?.props ?? {};
if (typeof source === 'number' || !source) {
return;
}
const sourceURI = addEncryptedAuthTokenToURL(source.uri);
fileDownload(sourceURI);
}, [videoPopoverMenuPlayerRef]);

Expand Down

0 comments on commit 9415778

Please sign in to comment.