Skip to content

Commit

Permalink
fix: replaced unsupported Object.hasOwn
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed May 17, 2023
1 parent 0b12e34 commit f165273
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const createGroupChannelCreateFragment = <UserType extends UserStruct>(

const _renderUser: NonNullable<typeof renderUser> = useFreshCallback((user, selectedUsers, setSelectedUsers) => {
if (queryCreator && !renderUser) {
const hasRequiredKey = Object.hasOwn(user, 'profileUrl') && Object.hasOwn(user, 'nickname');
const hasRequiredKey = 'profileUrl' in user && 'nickname' in user;
if (!hasRequiredKey) throw new Error('You should provide "renderUser" when providing "queryCreator"');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const createGroupChannelInviteFragment = <UserType extends UserStruct>(
const _renderUser: NonNullable<typeof renderUser> = useCallback(
(user, selectedUsers, setSelectedUsers) => {
if (queryCreator && !renderUser) {
const hasRequiredKey = Object.hasOwn(user, 'profileUrl') && Object.hasOwn(user, 'nickname');
const hasRequiredKey = 'profileUrl' in user && 'nickname' in user;
if (!hasRequiredKey) throw new Error('You should provide "renderUser" when providing "queryCreator"');
}

Expand Down

0 comments on commit f165273

Please sign in to comment.