Base functionality with SDK44.
This commit is contained in:
@@ -26,6 +26,7 @@ import {
|
||||
} from "../../redux/user/user.selectors";
|
||||
import { formatBytes } from "../../util/document-upload.utility";
|
||||
import { handleLocalUpload } from "../../util/local-document-upload.utility";
|
||||
import Toast from "react-native-toast-message";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
currentUser: selectCurrentUser,
|
||||
@@ -103,8 +104,13 @@ export function UploadProgress({
|
||||
},
|
||||
}));
|
||||
}
|
||||
function handleOnError(id) {
|
||||
function handleOnError(id, error) {
|
||||
logImEXEvent("imexmobile_upload_documents_error");
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "Unable to upload documents.",
|
||||
text2: (error && error.message) || JSON.stringify(error),
|
||||
});
|
||||
setProgress((progress) => ({
|
||||
...progress,
|
||||
action: t("mediabrowser.labels.converting"),
|
||||
@@ -191,7 +197,7 @@ export function UploadProgress({
|
||||
ev: {
|
||||
filename,
|
||||
mediaId: p.id,
|
||||
onError: () => handleOnError(p.id),
|
||||
onError: (error) => handleOnError(p.id, error),
|
||||
onProgress: ({ percent, loaded }) =>
|
||||
handleOnProgress(p.id, percent, loaded),
|
||||
onSuccess: () => handleOnSuccess(p.id, p),
|
||||
|
||||
Reference in New Issue
Block a user