Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33308787
D7530.1768802905.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7530.1768802905.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
Mon, Jan 19, 6:08 AM (18 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5954746
Default Alt Text
D7530.1768802905.diff (2 KB)
Attached To
Mode
D7530: [native] Replace logging with `Alert`s in `selectFromGalleryAndUpdateUserAvatar`
Attached
Detach File
Event Timeline
Log In to Comment