Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3405982
D8019.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
D8019.diff
View Options
diff --git a/native/avatars/edit-user-avatar-provider.react.js b/native/avatars/edit-user-avatar-provider.react.js
--- a/native/avatars/edit-user-avatar-provider.react.js
+++ b/native/avatars/edit-user-avatar-provider.react.js
@@ -33,6 +33,14 @@
updateUserAvatarActionTypes,
);
+const displayFailureAlert = () =>
+ Alert.alert(
+ 'Couldn’t save avatar',
+ 'Please try again later',
+ [{ text: 'OK' }],
+ { cancelable: true },
+ );
+
type Props = {
+children: React.Node,
};
@@ -72,7 +80,7 @@
try {
return await updateUserAvatarCall(imageAvatarUpdateRequest);
} catch (e) {
- Alert.alert('Avatar update failed', 'Unable to update avatar.');
+ displayFailureAlert();
throw e;
}
})(),
@@ -95,7 +103,7 @@
try {
return await updateUserAvatarCall(avatarRequest);
} catch (e) {
- Alert.alert('Avatar update failed', 'Unable to update avatar.');
+ displayFailureAlert();
throw e;
}
})();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 5, 12:01 AM (12 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2615209
Default Alt Text
D8019.diff (1 KB)
Attached To
Mode
D8019: [native] Use Alert from old useSaveUserAvatar in new setUserAvatar
Attached
Detach File
Event Timeline
Log In to Comment