Just use a toast for download notifications

The minor convenience of having that notification
doesn't justify me adding the library.
If I find another reason for me to have notifications
then i'll do it.
This commit is contained in:
Brandon Presley 2022-11-22 22:18:15 +13:00
parent c50dc4aacf
commit 434f29652f
1 changed files with 3 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import {NativeModules, PermissionsAndroid, Platform} from 'react-native'
import {PermissionsAndroid, Platform} from 'react-native'
import {Dirs, FileSystem} from 'react-native-file-access'
import {toast} from './toast'
export const write = async (name: string, data: string) => {
const filePath = `${Dirs.DocumentDir}/${name}`
@ -15,5 +16,5 @@ export const write = async (name: string, data: string) => {
await FileSystem.writeFile(filePath, data)
if (Platform.OS === 'android')
await FileSystem.cpExternal(filePath, name, 'downloads')
NativeModules.DownloadModule.show(name)
toast(`Downloaded ${name}`)
}