Skip to content

Commit 8901ead

Browse files
committed
updated android version code and hide progress when download empty files
1 parent af4f43b commit 8901ead

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎android/app/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ android {
8888
applicationId 'com.internxt.cloud'
8989
minSdkVersion rootProject.ext.minSdkVersion
9090
targetSdkVersion rootProject.ext.targetSdkVersion
91-
versionCode 114
91+
versionCode 115
9292
versionName "1.8.4"
9393

9494
buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())

‎src/components/modals/DriveItemInfoModal/index.tsx‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ function DriveItemInfoModal(): JSX.Element {
186186
return decryptedFilePath;
187187
}
188188

189-
setDownloadProgress({ totalBytes: 0, progress: 0, bytesReceived: 0 });
190-
setExporting(true);
191-
192189
let downloadPath: string;
193190

194191
if (isEmptyFile(item)) {
@@ -198,10 +195,11 @@ function DriveItemInfoModal(): JSX.Element {
198195
if (!item.fileId) {
199196
throw new Error('Item fileID not found for non-empty file');
200197
}
198+
setDownloadProgress({ totalBytes: 0, progress: 0, bytesReceived: 0 });
199+
setExporting(true);
201200
downloadPath = await downloadItem(item.fileId, item.bucket as string, decryptedFilePath, fileSize);
201+
setExporting(false);
202202
}
203-
204-
setExporting(false);
205203
await fs.shareFile({
206204
title: item.name,
207205
fileUri: downloadPath,
@@ -247,13 +245,13 @@ function DriveItemInfoModal(): JSX.Element {
247245

248246
// 2. If the file doesn't exists, download it
249247
if (!existsDecrypted) {
250-
setExporting(true);
251248
if (isEmptyFile(item)) {
252249
await drive.file.createEmptyDownloadedFile(decryptedFilePath);
253250
} else {
251+
setExporting(true);
254252
await downloadItem(item.fileId as string, item.bucket as string, decryptedFilePath, fileSize);
253+
setExporting(false);
255254
}
256-
setExporting(false);
257255
}
258256

259257
// 3. Copy the decrypted file (is a tmp, so this will dissapear, that's why we copy it)
@@ -307,6 +305,8 @@ function DriveItemInfoModal(): JSX.Element {
307305
fileUri: decryptedFilePath,
308306
saveToiOSFiles: true,
309307
});
308+
309+
notifications.success(strings.messages.driveDownloadSuccess);
310310
} catch (error) {
311311
notifications.error(strings.errors.generic.message);
312312
logger.error('Error on handleiOSSaveToFiles function:', JSON.stringify(error));

0 commit comments

Comments
 (0)