1.3.6-1 Release - Toast for successful push.

This commit is contained in:
Patrick Fic
2022-05-17 18:18:39 -07:00
parent 1af1f6a679
commit 9c101e8bd4
3 changed files with 17 additions and 3 deletions

4
.gitignore vendored
View File

@@ -12,3 +12,7 @@ yarn-error.log
# macOS
.DS_Store
*.ipa
*.aab

View File

@@ -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: {

View File

@@ -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);
}