Resolve android compatibility issues.

This commit is contained in:
Patrick Fic
2022-01-10 14:49:23 -08:00
parent 389b637891
commit 37bede677a
7 changed files with 18 additions and 12 deletions

View File

@@ -65,9 +65,9 @@ export function UploadProgress({
//if (!uploads) return null;
function handleOnSuccess(id) {
function handleOnSuccess(id, asset) {
logImEXEvent("imexmobile_successful_upload");
filesToDelete.push(id);
filesToDelete.push(asset);
setProgress((progress) => ({
...progress,
action: t("mediabrowser.labels.converting"),
@@ -173,6 +173,10 @@ export function UploadProgress({
if (deleteAfterUpload) {
try {
console.log(filesToDelete);
filesToDelete.forEach(
async (f) => await MediaLibrary.migrateAlbumIfNeededAsync(f.albumId)
);
const result = await MediaLibrary.deleteAssetsAsync(filesToDelete);
console.log("Delete Result", result);
} catch (error) {
@@ -203,7 +207,7 @@ export function UploadProgress({
onError: handleOnError,
onProgress: ({ percent, loaded }) =>
handleOnProgress(p.id, percent, loaded),
onSuccess: () => handleOnSuccess(p.id),
onSuccess: () => handleOnSuccess(p.id, p),
},
{
bodyshop: bodyshop,
@@ -233,9 +237,6 @@ export function UploadProgress({
visible={progress.uploadInProgress}
animationType="slide"
transparent={true}
onRequestClose={() => {
Alert.alert("Modal has been closed.");
}}
>
<View style={styles.modal}>
{progress.loading && <ActivityIndicator />}