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

@@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next";
import { FlatList, RefreshControl, Text } from "react-native";
import { Card } from "react-native-paper";
import JobNotesItem from "../job-notes-item/job-notes-item.component";
export default function JobNotes({ job, loading, refetch }) {
const { t } = useTranslation();
if (!job) {

View File

@@ -173,11 +173,6 @@ export function ScreenMainComponent({
(bodyshop.features.allAccess === true ||
moment(bodyshop.features.mobile).isAfter(moment()));
console.log(
"🚀 ~ file: screen-main.component.jsx ~ line 171 ~ hasMobileAccess",
hasMobileAccess,
bodyshop && bodyshop.features
);
return (
<SafeAreaView style={{ flex: 1 }}>
<NavigationContainer>
@@ -187,7 +182,7 @@ export function ScreenMainComponent({
bodyshop && hasMobileAccess ? (
<BottomTabsNavigator />
) : (
<ScreenSplash noAccess />
<ScreenSplash noAccess={bodyshop} />
)
) : (
<ScreenSignIn />

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 />}