From 37bede677a9e9e8d8bf00e7bff985b5a8c8045da Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 10 Jan 2022 14:49:23 -0800 Subject: [PATCH] Resolve android compatibility issues. --- App.js | 2 ++ components/job-notes/job-notes.component.jsx | 1 + components/screen-main/screen-main.component.jsx | 7 +------ .../upload-progress/upload-progress.component.jsx | 13 +++++++------ package.json | 1 + translations/i18n.js | 1 + yarn.lock | 5 +++++ 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/App.js b/App.js index c08772f..33703e3 100644 --- a/App.js +++ b/App.js @@ -9,6 +9,8 @@ import { logImEXEvent } from "./firebase/firebase.analytics"; import { client } from "./graphql/client"; import { persistor, store } from "./redux/store"; import "./translations/i18n"; +import "intl"; +import "intl/locale-data/jsonp/en"; Sentry.init({ dsn: "https://8d6c3de1940a4e4f8b81cf4d2150bdea@o492140.ingest.sentry.io/5558869", diff --git a/components/job-notes/job-notes.component.jsx b/components/job-notes/job-notes.component.jsx index 01b9695..d466259 100644 --- a/components/job-notes/job-notes.component.jsx +++ b/components/job-notes/job-notes.component.jsx @@ -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) { diff --git a/components/screen-main/screen-main.component.jsx b/components/screen-main/screen-main.component.jsx index 0107337..c2bfffb 100644 --- a/components/screen-main/screen-main.component.jsx +++ b/components/screen-main/screen-main.component.jsx @@ -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 ( @@ -187,7 +182,7 @@ export function ScreenMainComponent({ bodyshop && hasMobileAccess ? ( ) : ( - + ) ) : ( diff --git a/components/upload-progress/upload-progress.component.jsx b/components/upload-progress/upload-progress.component.jsx index 7b9f1cc..77bdde4 100644 --- a/components/upload-progress/upload-progress.component.jsx +++ b/components/upload-progress/upload-progress.component.jsx @@ -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."); - }} > {progress.loading && } diff --git a/package.json b/package.json index 86e42a9..9e8b925 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "formik": "^2.2.9", "graphql": "^16.2.0", "i18next": "^21.6.4", + "intl": "^1.2.5", "lodash": "^4.17.20", "luxon": "^2.2.0", "moment": "^2.29.1", diff --git a/translations/i18n.js b/translations/i18n.js index d6ce525..c3e755b 100644 --- a/translations/i18n.js +++ b/translations/i18n.js @@ -31,6 +31,7 @@ i18n.use(initReactI18next).init({ lng: "en-US", fallbackLng: "en-US", resources, + compatibilityJSON: "v3", // have a common namespace used around the full app // ns: ["common"], // defaultNS: "common", diff --git a/yarn.lock b/yarn.lock index d409fae..1d7adbc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4766,6 +4766,11 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== +intl@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde" + integrity sha1-giRKIZDE5Bn4Nx9ao02qNCDiq94= + invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"