1.3.6-1 Release - Toast for successful push.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -12,3 +12,7 @@ yarn-error.log
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
|
||||
*.ipa
|
||||
*.aab
|
||||
@@ -65,7 +65,14 @@ export function UploadProgress({
|
||||
|
||||
//if (!uploads) return null;
|
||||
|
||||
function handleOnSuccess(id, asset) {
|
||||
function handleOnSuccess(id, asset, { duration }) {
|
||||
//If it's not in production, show a toast with the time.
|
||||
Toast.show({
|
||||
type: "success",
|
||||
text1: `${duration} - Upload completed for ${asset.filename}.`,
|
||||
text2: duration,
|
||||
});
|
||||
|
||||
logImEXEvent("imexmobile_successful_upload");
|
||||
filesToDelete.push(asset);
|
||||
setProgress((progress) => ({
|
||||
@@ -199,7 +206,7 @@ export function UploadProgress({
|
||||
onError: (error) => handleOnError(p.id, error),
|
||||
onProgress: ({ percent, loaded }) =>
|
||||
handleOnProgress(p.id, percent, loaded),
|
||||
onSuccess: () => handleOnSuccess(p.id, p),
|
||||
onSuccess: ({ duration }) => handleOnSuccess(p.id, p, { duration }),
|
||||
file: p,
|
||||
},
|
||||
context: {
|
||||
|
||||
@@ -114,7 +114,10 @@ export const handleLocalUpload = async ({ ev, context }) => {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
onSuccess && onSuccess();
|
||||
onSuccess &&
|
||||
onSuccess({
|
||||
duration: imexMediaServerResponse.headers["x-response-time"],
|
||||
});
|
||||
console.log("Succesful upload", imageData.filename);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user