1.3.6-2 Test Build - Individual file uploads & cloudariny fixes.

This commit is contained in:
Patrick Fic
2022-05-17 18:58:10 -07:00
parent 9c101e8bd4
commit 5633eeb24d
5 changed files with 69 additions and 68 deletions

View File

@@ -70,7 +70,8 @@ export function UploadProgress({
Toast.show({
type: "success",
text1: `${duration} - Upload completed for ${asset.filename}.`,
text2: duration,
//
// text2: duration,
});
logImEXEvent("imexmobile_successful_upload");
@@ -82,6 +83,7 @@ export function UploadProgress({
...progress.files,
[id]: {
...progress.files[id],
percent: 1,
action: t("mediabrowser.labels.converting"),
},
},
@@ -92,7 +94,7 @@ export function UploadProgress({
function handleOnProgress(uri, percent, loaded) {
setProgress((progress) => ({
...progress,
speed: loaded - progress.files[uri].loaded,
// speed: loaded - progress.files[uri].loaded,
action:
percent === 1
? t("mediabrowser.labels.converting")
@@ -102,6 +104,7 @@ export function UploadProgress({
[uri]: {
...progress.files[uri],
percent,
speed: loaded - progress.files[uri].loaded,
action:
percent === 1
? t("mediabrowser.labels.converting")
@@ -117,6 +120,7 @@ export function UploadProgress({
type: "error",
text1: "Unable to upload documents.",
text2: (error && error.message) || JSON.stringify(error),
autoHide: false,
});
setProgress((progress) => ({
...progress,
@@ -236,18 +240,11 @@ export function UploadProgress({
visible={progress.uploadInProgress}
animationType="slide"
transparent={true}
onRequestClose={() => {
Alert.alert("Modal has been closed.");
}}
onRequestClose={() => {}}
>
<View style={styles.modal}>
{progress.loading && <ActivityIndicator />}
{progress.action && (
<Text>{`${progress.action} ${
(progress.speed !== 0 || !progress.speed) &&
`- ${formatBytes(progress.speed)}/sec`
}`}</Text>
)}
<ScrollView contentContainerStyle={styles.centeredView}>
{Object.keys(progress.files).map((key) => (
<View key={progress.files[key].id} style={styles.progressItem}>
@@ -260,6 +257,11 @@ export function UploadProgress({
style={styles.progress}
color={progress.files[key].percent === 1 ? "green" : "blue"}
/>
{progress.files[key].speed !== 0 &&
progress.files[key].speed &&
!isNaN(progress.files[key].speed) ? (
<Text>{`${formatBytes(progress.files[key].speed)}/sec`}</Text>
) : null}
</View>
</View>
))}
@@ -271,7 +273,7 @@ export function UploadProgress({
const styles = StyleSheet.create({
modal: {
flex: 1,
marginTop: 50,
marginTop: 80,
marginBottom: 60,
marginLeft: 20,
marginRight: 20,

View File

@@ -75,6 +75,7 @@ export function UploadProgress({
...progress.files,
[id]: {
...progress.files[id],
percent: 1,
action: t("mediabrowser.labels.converting"),
},
},
@@ -95,6 +96,7 @@ export function UploadProgress({
[uri]: {
...progress.files[uri],
percent,
speed: loaded - progress.files[uri].loaded,
action:
percent === 1
? t("mediabrowser.labels.converting")
@@ -248,12 +250,7 @@ export function UploadProgress({
>
<View style={styles.modal}>
{progress.loading && <ActivityIndicator />}
{progress.action && (
<Text>{`${progress.action} ${
(progress.speed !== 0 || !progress.speed) &&
`- ${formatBytes(progress.speed)}/sec`
}`}</Text>
)}
<ScrollView contentContainerStyle={styles.centeredView}>
{Object.keys(progress.files).map((key) => (
<View key={progress.files[key].id} style={styles.progressItem}>
@@ -266,6 +263,11 @@ export function UploadProgress({
style={styles.progress}
color={progress.files[key].percent === 1 ? "green" : "blue"}
/>
{progress.files[key].speed !== 0 &&
progress.files[key].speed &&
!isNaN(progress.files[key].speed) ? (
<Text>{`${formatBytes(progress.files[key].speed)}/sec`}</Text>
) : null}
</View>
</View>
))}