From 1dc038d3214e7433ad739a1a0e91aef83d90b196 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Tue, 30 May 2023 11:07:34 -0300 Subject: [PATCH] refactor some changes requested --- app/containers/message/Audio.tsx | 11 +++++------ app/containers/message/Image.tsx | 2 +- app/containers/message/Video.tsx | 8 +++----- .../methods}/autoDownloadPreference.ts | 10 +++++----- app/lib/methods/handleMediaDownload.ts | 6 +++++- app/views/MediaAutoDownloadView/index.tsx | 14 ++++---------- app/views/SettingsView/index.tsx | 8 ++++---- 7 files changed, 27 insertions(+), 32 deletions(-) rename app/{containers/message/helpers/mediaDownload => lib/methods}/autoDownloadPreference.ts (76%) diff --git a/app/containers/message/Audio.tsx b/app/containers/message/Audio.tsx index 53b27942d..3ab079e92 100644 --- a/app/containers/message/Audio.tsx +++ b/app/containers/message/Audio.tsx @@ -22,7 +22,7 @@ import { TSupportedThemes } from '../../theme'; import { MediaTypes, downloadMediaFile, searchMediaFileAsync } from '../../lib/methods/handleMediaDownload'; import EventEmitter from '../../lib/methods/helpers/events'; import { PAUSE_AUDIO } from './constants'; -import { isAutoDownloadEnabled } from './helpers/mediaDownload/autoDownloadPreference'; +import { isAutoDownloadEnabled } from '../../lib/methods/autoDownloadPreference'; interface IButton { loading: boolean; @@ -107,8 +107,7 @@ const Button = React.memo(({ loading, paused, onPress, disabled, theme, toDownlo disabled={disabled} onPress={onPress} hitSlop={BUTTON_HIT_SLOP} - background={Touchable.SelectableBackgroundBorderless()} - > + background={Touchable.SelectableBackgroundBorderless()}> {loading ? ( ) : ( @@ -180,7 +179,8 @@ class MessageAudio extends React.Component + ]}>