avoid auto download from reply

This commit is contained in:
Reinaldo Neto 2023-06-26 20:33:24 -03:00
parent 332e51f2db
commit 469d42bdd0
3 changed files with 4 additions and 1 deletions

View File

@ -143,7 +143,7 @@ class MessageAudio extends React.Component<IMessageAudioProps, IMessageAudioStat
}; };
async componentDidMount() { async componentDidMount() {
const { file } = this.props; const { file, isReply } = this.props;
const cachedAudioResult = await searchMediaFileAsync({ const cachedAudioResult = await searchMediaFileAsync({
type: 'audio', type: 'audio',
mimeType: file.audio_type, mimeType: file.audio_type,
@ -154,6 +154,7 @@ class MessageAudio extends React.Component<IMessageAudioProps, IMessageAudioStat
await this.sound.loadAsync({ uri: cachedAudioResult.file.uri }); await this.sound.loadAsync({ uri: cachedAudioResult.file.uri });
return this.setState({ loading: false }); return this.setState({ loading: false });
} }
if (isReply) return;
await this.handleAutoDownload(); await this.handleAutoDownload();
} }

View File

@ -108,6 +108,7 @@ const ImageContainer = React.memo(
})); }));
return setCached(true); return setCached(true);
} }
if (isReply) return;
if (isDownloadActive('image', imgUrlToCache)) { if (isDownloadActive('image', imgUrlToCache)) {
return setLoading(true); return setLoading(true);
} }

View File

@ -101,6 +101,7 @@ const Video = React.memo(
} }
return; return;
} }
if (isReply) return;
if (downloadActive) return setLoading(true); if (downloadActive) return setLoading(true);
await handleAutoDownload(); await handleAutoDownload();
} }