1.3.6-4 Test Build - Add average upload for local upload.
This commit is contained in:
6
app.json
6
app.json
@@ -4,19 +4,19 @@
|
|||||||
"slug": "imexmobile",
|
"slug": "imexmobile",
|
||||||
"version": "1.3.6",
|
"version": "1.3.6",
|
||||||
"extra": {
|
"extra": {
|
||||||
"expover": "3"
|
"expover": "4"
|
||||||
},
|
},
|
||||||
"orientation": "default",
|
"orientation": "default",
|
||||||
"icon": "./assets/logo192noa.png",
|
"icon": "./assets/logo192noa.png",
|
||||||
"ios": {
|
"ios": {
|
||||||
"supportsTablet": true,
|
"supportsTablet": true,
|
||||||
"bundleIdentifier": "com.imex.imexmobile",
|
"bundleIdentifier": "com.imex.imexmobile",
|
||||||
"buildNumber": "3",
|
"buildNumber": "4",
|
||||||
"googleServicesFile": "./GoogleService-Info.plist"
|
"googleServicesFile": "./GoogleService-Info.plist"
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"package": "com.imex.imexmobile",
|
"package": "com.imex.imexmobile",
|
||||||
"versionCode": 1100008,
|
"versionCode": 1100009,
|
||||||
"googleServicesFile": "./google-services.json"
|
"googleServicesFile": "./google-services.json"
|
||||||
},
|
},
|
||||||
"splash": {
|
"splash": {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import * as MediaLibrary from "expo-media-library";
|
import * as MediaLibrary from "expo-media-library";
|
||||||
|
import { DateTime } from "luxon";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import {
|
import {
|
||||||
@@ -71,11 +72,7 @@ export function UploadProgress({
|
|||||||
});
|
});
|
||||||
|
|
||||||
logImEXEvent("imexmobile_successful_upload");
|
logImEXEvent("imexmobile_successful_upload");
|
||||||
setProgress({
|
setProgress({ ...progress, speed: 0, percent: 1, uploadInProgress: false });
|
||||||
speed: 0,
|
|
||||||
percent: 1,
|
|
||||||
uploadInProgress: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleOnProgress({ percent, loaded }) {
|
function handleOnProgress({ percent, loaded }) {
|
||||||
@@ -103,6 +100,8 @@ export function UploadProgress({
|
|||||||
percent: 0,
|
percent: 0,
|
||||||
loaded: 0,
|
loaded: 0,
|
||||||
uploadInProgress: true,
|
uploadInProgress: true,
|
||||||
|
start: new Date(),
|
||||||
|
average: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
await handleLocalUpload({
|
await handleLocalUpload({
|
||||||
@@ -144,6 +143,7 @@ export function UploadProgress({
|
|||||||
forceRerender();
|
forceRerender();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(progress);
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
visible={progress.uploadInProgress}
|
visible={progress.uploadInProgress}
|
||||||
@@ -173,6 +173,18 @@ export function UploadProgress({
|
|||||||
<Text style={{ alignSelf: "center", marginTop: 16 }}>{`${formatBytes(
|
<Text style={{ alignSelf: "center", marginTop: 16 }}>{`${formatBytes(
|
||||||
progress.speed
|
progress.speed
|
||||||
)}/sec`}</Text>
|
)}/sec`}</Text>
|
||||||
|
<Text
|
||||||
|
style={{ alignSelf: "center", marginTop: 16 }}
|
||||||
|
>{`Avg. ${formatBytes(
|
||||||
|
progress.loaded / ((new Date() - progress.start) / 1000)
|
||||||
|
)}/sec`}</Text>
|
||||||
|
<Text
|
||||||
|
style={{ alignSelf: "center", marginTop: 16 }}
|
||||||
|
>{`Total Uploaded ${formatBytes(progress.loaded)}/sec`}</Text>
|
||||||
|
<Text style={{ alignSelf: "center", marginTop: 16 }}>{`Duration ${(
|
||||||
|
(new Date() - progress.start) /
|
||||||
|
1000
|
||||||
|
).toFixed(1)} sec`}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
Reference in New Issue
Block a user