From 27b3575fcfd164957ffa188ba1dc2410197f24f3 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 5 Jun 2023 10:38:57 +0500 Subject: [PATCH] mobile: guard ios functions --- apps/mobile/app/common/filesystem/upload.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/mobile/app/common/filesystem/upload.js b/apps/mobile/app/common/filesystem/upload.js index c7469105b..e2739ff51 100644 --- a/apps/mobile/app/common/filesystem/upload.js +++ b/apps/mobile/app/common/filesystem/upload.js @@ -40,11 +40,13 @@ export async function uploadFile(filename, data, cancelToken) { if (!uploadUrl) throw new Error("Unable to resolve upload url"); let uploadFilePath = `${cacheDir}/${filename}`; - const iosAppGroup = await RNFetchBlob.fs.pathForAppGroup(IOS_APPGROUPID); + const iosAppGroup = + Platform.OS === "ios" + ? await RNFetchBlob.fs.pathForAppGroup(IOS_APPGROUPID) + : null; const appGroupPath = `${iosAppGroup}/${filename}`; let exists = await RNFetchBlob.fs.exists(uploadFilePath); if (!exists && Platform.OS === "ios") { - console.log("Upload file from app group path"); uploadFilePath = appGroupPath; }