diff --git a/packages/uikit-chat-hooks/src/common/useUserList.ts b/packages/uikit-chat-hooks/src/common/useUserList.ts index 247e61c43..0e985708d 100644 --- a/packages/uikit-chat-hooks/src/common/useUserList.ts +++ b/packages/uikit-chat-hooks/src/common/useUserList.ts @@ -119,7 +119,7 @@ export const useUserList = < }); const next = useFreshCallback(async () => { - if (query.current && query.current?.hasNext) { + if (query.current && query.current?.hasNext && !query.current.isLoading) { const nextUsers = await query.current.next().catch((e) => { Logger.error(e); if (e.code === SBErrorCode.UNAUTHORIZED_REQUEST) Logger.warn(SBErrorMessage.ACL); diff --git a/packages/uikit-react-native/src/components/ChannelInput/index.tsx b/packages/uikit-react-native/src/components/ChannelInput/index.tsx index 656c16ad2..b8b36c2c8 100644 --- a/packages/uikit-react-native/src/components/ChannelInput/index.tsx +++ b/packages/uikit-react-native/src/components/ChannelInput/index.tsx @@ -192,7 +192,7 @@ const useTypingTrigger = (text: string, channel: SendbirdBaseChannel) => { () => { function triggerTyping() { if (channel.isGroupChannel()) { - const action = text.length === 0 ? channel.endTyping : channel.startTyping; + const action = () => (text.length === 0 ? channel.endTyping() : channel.startTyping()); action().catch((error) => { Logger.debug('ChannelInput: Failed to trigger typing', error); }); diff --git a/packages/uikit-react-native/src/components/ReactionAddons/BottomSheetReactionAddon.tsx b/packages/uikit-react-native/src/components/ReactionAddons/BottomSheetReactionAddon.tsx index dbb7ea3cc..b7c70b680 100644 --- a/packages/uikit-react-native/src/components/ReactionAddons/BottomSheetReactionAddon.tsx +++ b/packages/uikit-react-native/src/components/ReactionAddons/BottomSheetReactionAddon.tsx @@ -47,7 +47,10 @@ const BottomSheetReactionAddon = ({ onClose, message, channel }: Props) => { const reacted = currentUserIdx > -1; const onPress = async () => { - const action = reacted ? channel.deleteReaction : channel.addReaction; + const action = (message: BaseMessage, key: string) => { + return reacted ? channel.deleteReaction(message, key) : channel.addReaction(message, key); + }; + await action(message, key) .catch((error) => { Logger.warn('Failed to reaction', error); diff --git a/packages/uikit-react-native/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx b/packages/uikit-react-native/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx index c18f90444..8cdce2d87 100644 --- a/packages/uikit-react-native/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx +++ b/packages/uikit-react-native/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx @@ -2,6 +2,7 @@ import React from 'react'; import { FlatList, Pressable, View, useWindowDimensions } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; +import type { BaseMessage } from '@sendbird/chat/message'; import { Image, Modal, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation'; import { Logger } from '@sendbird/uikit-utils'; @@ -56,7 +57,10 @@ const ReactionListBottomSheet = ({ visible, onClose, onDismiss, reactionCtx, cha key={key} onPress={async () => { if (message && channel) { - const action = reacted ? channel.deleteReaction : channel.addReaction; + const action = (message: BaseMessage, key: string) => { + return reacted ? channel.deleteReaction(message, key) : channel.addReaction(message, key); + }; + action(message, key).catch((error) => { Logger.warn('Failed to reaction', error); }); diff --git a/packages/uikit-react-native/src/hooks/usePushTokenRegistration.ts b/packages/uikit-react-native/src/hooks/usePushTokenRegistration.ts index f2e381f31..84a85a7dd 100644 --- a/packages/uikit-react-native/src/hooks/usePushTokenRegistration.ts +++ b/packages/uikit-react-native/src/hooks/usePushTokenRegistration.ts @@ -21,8 +21,8 @@ const usePushTokenRegistration = () => { default: (token: string) => sdk.unregisterFCMPushTokenForCurrentUser(token), }), Platform.select({ - ios: notificationService.getAPNSToken, - default: notificationService.getFCMToken, + ios: () => notificationService.getAPNSToken(), + default: () => notificationService.getFCMToken(), }), ]; });