diff --git a/app.json b/app.json index 8f402dc..359f765 100644 --- a/app.json +++ b/app.json @@ -4,19 +4,19 @@ "slug": "imexmobile", "version": "1.3.6", "extra": { - "expover": "3" + "expover": "4" }, "orientation": "default", "icon": "./assets/logo192noa.png", "ios": { "supportsTablet": true, "bundleIdentifier": "com.imex.imexmobile", - "buildNumber": "3", + "buildNumber": "4", "googleServicesFile": "./GoogleService-Info.plist" }, "android": { "package": "com.imex.imexmobile", - "versionCode": 1100008, + "versionCode": 1100009, "googleServicesFile": "./google-services.json" }, "splash": { diff --git a/components/local-upload-progress/local-upload-progress.component.jsx b/components/local-upload-progress/local-upload-progress.component.jsx index 2718bfc..4df3132 100644 --- a/components/local-upload-progress/local-upload-progress.component.jsx +++ b/components/local-upload-progress/local-upload-progress.component.jsx @@ -1,4 +1,5 @@ import * as MediaLibrary from "expo-media-library"; +import { DateTime } from "luxon"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { @@ -71,11 +72,7 @@ export function UploadProgress({ }); logImEXEvent("imexmobile_successful_upload"); - setProgress({ - speed: 0, - percent: 1, - uploadInProgress: false, - }); + setProgress({ ...progress, speed: 0, percent: 1, uploadInProgress: false }); } function handleOnProgress({ percent, loaded }) { @@ -103,6 +100,8 @@ export function UploadProgress({ percent: 0, loaded: 0, uploadInProgress: true, + start: new Date(), + average: 0, }); await handleLocalUpload({ @@ -144,6 +143,7 @@ export function UploadProgress({ forceRerender(); }; + console.log(progress); return ( {`${formatBytes( progress.speed )}/sec`} + {`Avg. ${formatBytes( + progress.loaded / ((new Date() - progress.start) / 1000) + )}/sec`} + {`Total Uploaded ${formatBytes(progress.loaded)}/sec`} + {`Duration ${( + (new Date() - progress.start) / + 1000 + ).toFixed(1)} sec`}