diff --git a/native/avatars/avatar-hooks.js b/native/avatars/avatar-hooks.js index e6a3f3df32..9510444481 100644 --- a/native/avatars/avatar-hooks.js +++ b/native/avatars/avatar-hooks.js @@ -214,9 +214,7 @@ function useNativeUpdateUserImageAvatar(): ( } function useSelectFromGalleryAndUpdateUserAvatar(): () => Promise { - const editUserAvatarContext = React.useContext(EditUserAvatarContext); - invariant(editUserAvatarContext, 'updateImageUserAvatar must be defined'); - const { updateImageUserAvatar } = editUserAvatarContext; + const nativeUpdateUserImageAvatar = useNativeUpdateUserImageAvatar(); const selectFromGalleryAndUpdateUserAvatar = React.useCallback(async (): Promise => { @@ -224,8 +222,8 @@ function useSelectFromGalleryAndUpdateUserAvatar(): () => Promise { if (!selection) { return; } - await updateImageUserAvatar(selection); - }, [updateImageUserAvatar]); + await nativeUpdateUserImageAvatar(selection); + }, [nativeUpdateUserImageAvatar]); return selectFromGalleryAndUpdateUserAvatar; }