Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3394732
D7530.id25390.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7530.id25390.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
@@ -4,6 +4,7 @@
import * as ImagePicker from 'expo-image-picker';
import * as React from 'react';
import { Platform } from 'react-native';
+import Alert from 'react-native/Libraries/Alert/Alert.js';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import {
@@ -161,7 +162,10 @@
const selectFromGalleryAndUpdateUserAvatar = React.useCallback(async () => {
const selection: ?MediaLibrarySelection = await selectFromGallery();
if (!selection) {
- console.log('MEDIA_SELECTION_FAILED');
+ Alert.alert(
+ 'Media selection failed',
+ 'Unable to select media from Media Library.',
+ );
return;
}
@@ -170,13 +174,19 @@
try {
processedMedia = await processSelectedMedia(selection);
} catch (e) {
- console.log('MEDIA_PROCESSING_FAILED');
+ Alert.alert(
+ 'Media processing failed',
+ 'Unable to process selected media.',
+ );
setProcessingOrUploadInProgress(false);
return;
}
if (!processedMedia || !processedMedia.success) {
- console.log('MEDIA_PROCESSING_FAILED');
+ Alert.alert(
+ 'Media processing failed',
+ 'Unable to process selected media.',
+ );
setProcessingOrUploadInProgress(false);
return;
}
@@ -185,13 +195,19 @@
try {
uploadedMedia = await uploadProcessedMedia(processedMedia);
} catch {
- console.log('MEDIA_UPLOAD_FAILED');
+ Alert.alert(
+ 'Media upload failed',
+ 'Unable to upload selected media. Please try again.',
+ );
setProcessingOrUploadInProgress(false);
return;
}
- if (!uploadedMedia) {
- console.log('MEDIA_UPLOAD_FAILED');
+ if (uploadedMedia) {
+ Alert.alert(
+ 'Media upload failed',
+ 'Unable to upload selected media. Please try again.',
+ );
setProcessingOrUploadInProgress(false);
return;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 9:36 PM (18 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2606160
Default Alt Text
D7530.id25390.diff (2 KB)
Attached To
Mode
D7530: [native] Replace logging with `Alert`s in `selectFromGalleryAndUpdateUserAvatar`
Attached
Detach File
Event Timeline
Log In to Comment