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 @@ -336,9 +336,7 @@ function useSelectFromGalleryAndUpdateThreadAvatar(): ( threadID: string, ) => Promise { - const editThreadAvatarContext = React.useContext(EditThreadAvatarContext); - invariant(editThreadAvatarContext, 'editThreadAvatarContext must be defined'); - const { updateImageThreadAvatar } = editThreadAvatarContext; + const nativeUpdateThreadImageAvatar = useNativeUpdateThreadImageAvatar(); const selectFromGalleryAndUpdateThreadAvatar = React.useCallback( async (threadID: string): Promise => { @@ -346,9 +344,9 @@ if (!selection) { return; } - await updateImageThreadAvatar(selection, threadID); + await nativeUpdateThreadImageAvatar(selection, threadID); }, - [updateImageThreadAvatar], + [nativeUpdateThreadImageAvatar], ); return selectFromGalleryAndUpdateThreadAvatar;