Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3749328
D8150.id27554.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8150.id27554.diff
View Options
diff --git a/native/avatars/avatar-hooks.js b/native/avatars/avatar-hooks.js
--- a/native/avatars/avatar-hooks.js
+++ b/native/avatars/avatar-hooks.js
@@ -114,14 +114,14 @@
}
function useUploadSelectedMedia(
- setProcessingOrUploadInProgress: (inProgress: boolean) => mixed,
+ setProcessingOrUploadInProgress?: (inProgress: boolean) => mixed,
): (selection: NativeMediaSelection) => Promise<?ImageAvatarDBContent> {
const processSelectedMedia = useProcessSelectedMedia();
const uploadProcessedMedia = useUploadProcessedMedia();
return React.useCallback(
async (selection: NativeMediaSelection) => {
- setProcessingOrUploadInProgress(true);
+ setProcessingOrUploadInProgress?.(true);
const urisToBeDisposed: Set<string> = new Set([selection.uri]);
let processedMedia;
@@ -136,7 +136,7 @@
'Media processing failed',
'Unable to process selected media.',
);
- setProcessingOrUploadInProgress(false);
+ setProcessingOrUploadInProgress?.(false);
return undefined;
}
@@ -146,7 +146,7 @@
'Media processing failed',
'Unable to process selected media.',
);
- setProcessingOrUploadInProgress(false);
+ setProcessingOrUploadInProgress?.(false);
return undefined;
}
@@ -160,7 +160,7 @@
'Media upload failed',
'Unable to upload selected media. Please try again.',
);
- setProcessingOrUploadInProgress(false);
+ setProcessingOrUploadInProgress?.(false);
return undefined;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 10, 9:22 PM (15 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2850330
Default Alt Text
D8150.id27554.diff (1 KB)
Attached To
Mode
D8150: [native] Make callback param optional in useUploadSelectedMedia avatar hook
Attached
Detach File
Event Timeline
Log In to Comment