remove the custom hook for autoDownload

This commit is contained in:
Reinaldo Neto 2023-05-15 23:50:08 -03:00
parent acb280fa36
commit 7108e35ae7
1 changed files with 0 additions and 16 deletions

View File

@ -1,5 +1,4 @@
import NetInfo, { NetInfoStateType } from '@react-native-community/netinfo'; import NetInfo, { NetInfoStateType } from '@react-native-community/netinfo';
import { useEffect, useState } from 'react';
import { import {
IMAGES_PREFERENCE_DOWNLOAD, IMAGES_PREFERENCE_DOWNLOAD,
@ -26,18 +25,3 @@ export const isAutoDownloadEnabled = async (mediaType: TMediaType, { author, use
author?._id === user.id author?._id === user.id
); );
}; };
export const useAutoDownloadEnabled = (mediaType: TMediaType, { author, user }: IUsersParam) => {
const [enabled, setEnabled] = useState(false);
useEffect(() => {
const handleAutoDownload = async () => {
const result = await isAutoDownloadEnabled(mediaType, { author, user });
console.log('🚀 ~ file: autoDownloadPreference.ts:38 ~ handleAutoDownload ~ result:', result);
setEnabled(result);
};
handleAutoDownload();
}, []);
return enabled;
};