HomePhabricator
Diffusion Comm 82a7ceda75f8

[native] Replace logging with `Alert`s in `selectFromGalleryAndUpdateUserAvatar`

Description

[native] Replace logging with Alerts in selectFromGalleryAndUpdateUserAvatar

Summary:
Replace console.log with Alerts so if something goes wrong with media selection/processing/uploading we can at least give the user an indication that the operation failed.

Proper error handling would include cleaning up temporary files + creating a media mission report, but deferring that for now.

NOTE: Currently if dispatchActionPromise of updateUserAvatarCall fails it'll fail silently. One possibility could be to wrap the call like we do in siwe-login-form to introspect (see below), or we could have a useEffect that Alert.alert(...)s if loadingStatus === 'error'?

046369.png (346×1 px, 64 KB)


Depends on D7529

Test Plan:
Flipped boolean and observed that Alert appeared as expected:

Simulator Screenshot - Fresh iPhone 14 Pro - 2023-04-19 at 14.55.31.png (2×1 px, 573 KB)

Reviewers: ashoat, ginsu

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D7530

Details