fix the name of searchMediaFIleAsync's result
This commit is contained in:
parent
c1fbc2066b
commit
e7244d9bbe
|
@ -144,14 +144,14 @@ class MessageAudio extends React.Component<IMessageAudioProps, IMessageAudioStat
|
|||
|
||||
async componentDidMount() {
|
||||
const { file } = this.props;
|
||||
const fileSearch = await searchMediaFileAsync({
|
||||
const cachedAudioResult = await searchMediaFileAsync({
|
||||
type: 'audio',
|
||||
mimeType: file.audio_type,
|
||||
urlToCache: this.getUrl()
|
||||
});
|
||||
this.filePath = fileSearch.filePath;
|
||||
if (fileSearch?.file?.exists) {
|
||||
await this.sound.loadAsync({ uri: fileSearch.file.uri });
|
||||
this.filePath = cachedAudioResult.filePath;
|
||||
if (cachedAudioResult?.file?.exists) {
|
||||
await this.sound.loadAsync({ uri: cachedAudioResult.file.uri });
|
||||
return this.setState({ loading: false });
|
||||
}
|
||||
await this.handleAutoDownload();
|
||||
|
|
|
@ -95,16 +95,16 @@ const ImageContainer = React.memo(
|
|||
useLayoutEffect(() => {
|
||||
const handleImageSearchAndDownload = async () => {
|
||||
if (img) {
|
||||
const searchImageCached = await searchMediaFileAsync({
|
||||
const cachedImageResult = await searchMediaFileAsync({
|
||||
type: 'image',
|
||||
mimeType: imageCached.image_type,
|
||||
urlToCache: imgUrlToCache
|
||||
});
|
||||
filePath.current = searchImageCached.filePath;
|
||||
if (searchImageCached.file?.exists) {
|
||||
filePath.current = cachedImageResult.filePath;
|
||||
if (cachedImageResult.file?.exists) {
|
||||
setImageCached(prev => ({
|
||||
...prev,
|
||||
title_link: searchImageCached.file?.uri
|
||||
title_link: cachedImageResult.file?.uri
|
||||
}));
|
||||
return setCached(true);
|
||||
}
|
||||
|
|
|
@ -84,17 +84,17 @@ const Video = React.memo(
|
|||
useEffect(() => {
|
||||
const handleVideoSearchAndDownload = async () => {
|
||||
if (video) {
|
||||
const searchVideoCached = await searchMediaFileAsync({
|
||||
const cachedVideoResult = await searchMediaFileAsync({
|
||||
type: 'video',
|
||||
mimeType: file.video_type,
|
||||
urlToCache: video
|
||||
});
|
||||
filePath.current = searchVideoCached.filePath;
|
||||
filePath.current = cachedVideoResult.filePath;
|
||||
const downloadActive = isDownloadActive('video', video);
|
||||
if (searchVideoCached.file?.exists) {
|
||||
if (cachedVideoResult.file?.exists) {
|
||||
setVideoCached(prev => ({
|
||||
...prev,
|
||||
video_url: searchVideoCached.file?.uri
|
||||
video_url: cachedVideoResult.file?.uri
|
||||
}));
|
||||
if (downloadActive) {
|
||||
cancelDownload('video', video);
|
||||
|
|
Loading…
Reference in New Issue