Skip to content

Commit c4561a0

Browse files
committed
fix: resolve this binding issues
1 parent 9547065 commit c4561a0

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

packages/uikit-react-native/src/components/ChannelInput/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ const useTypingTrigger = (text: string, channel: SendbirdBaseChannel) => {
192192
() => {
193193
function triggerTyping() {
194194
if (channel.isGroupChannel()) {
195-
const action = text.length === 0 ? channel.endTyping : channel.startTyping;
195+
const action = () => (text.length === 0 ? channel.endTyping() : channel.startTyping());
196196
action().catch((error) => {
197197
Logger.debug('ChannelInput: Failed to trigger typing', error);
198198
});

packages/uikit-react-native/src/components/ReactionAddons/BottomSheetReactionAddon.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ const BottomSheetReactionAddon = ({ onClose, message, channel }: Props) => {
4747
const reacted = currentUserIdx > -1;
4848

4949
const onPress = async () => {
50-
const action = reacted ? channel.deleteReaction : channel.addReaction;
50+
const action = (message: BaseMessage, key: string) => {
51+
return reacted ? channel.deleteReaction(message, key) : channel.addReaction(message, key);
52+
};
53+
5154
await action(message, key)
5255
.catch((error) => {
5356
Logger.warn('Failed to reaction', error);

packages/uikit-react-native/src/components/ReactionBottomSheets/ReactionListBottomSheet.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { FlatList, Pressable, View, useWindowDimensions } from 'react-native';
33
import { useSafeAreaInsets } from 'react-native-safe-area-context';
44

5+
import type { BaseMessage } from '@sendbird/chat/message';
56
import { Image, Modal, createStyleSheet, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
67
import { Logger } from '@sendbird/uikit-utils';
78

@@ -56,7 +57,10 @@ const ReactionListBottomSheet = ({ visible, onClose, onDismiss, reactionCtx, cha
5657
key={key}
5758
onPress={async () => {
5859
if (message && channel) {
59-
const action = reacted ? channel.deleteReaction : channel.addReaction;
60+
const action = (message: BaseMessage, key: string) => {
61+
return reacted ? channel.deleteReaction(message, key) : channel.addReaction(message, key);
62+
};
63+
6064
action(message, key).catch((error) => {
6165
Logger.warn('Failed to reaction', error);
6266
});

packages/uikit-react-native/src/hooks/usePushTokenRegistration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const usePushTokenRegistration = () => {
2121
default: (token: string) => sdk.unregisterFCMPushTokenForCurrentUser(token),
2222
}),
2323
Platform.select({
24-
ios: notificationService.getAPNSToken,
25-
default: notificationService.getFCMToken,
24+
ios: () => notificationService.getAPNSToken(),
25+
default: () => notificationService.getFCMToken(),
2626
}),
2727
];
2828
});

0 commit comments

Comments
 (0)