Skip to content

Commit 4acfeca

Browse files
authored
Merge pull request #100 from sendbird/fix/flat-list-internal
fix: flatlist internal condition
2 parents 0478bcc + ff48e36 commit 4acfeca

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/uikit-react-native/src/components/ChatFlatList/FlatListInternal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ type BidirectionalProps<T> = {
1717
};
1818

1919
function shouldUseScrollViewEnhancer() {
20+
if (Platform.OS !== 'android') return false;
21+
2022
if (Platform.constants.reactNativeVersion.major < 1) {
2123
if (Platform.constants.reactNativeVersion.minor < 72) {
2224
return true;
2325
}
2426
}
2527
return false;
2628
}
29+
2730
function getFlatList(): FlatListBidirectional {
2831
if (shouldUseScrollViewEnhancer()) {
2932
try {

sample/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ const Navigations = () => {
126126
}, []);
127127

128128
useEffect(() => {
129-
const { remove } = AppState.addEventListener('change', async () => {
129+
const subscriber = AppState.addEventListener('change', async () => {
130130
const count = await sdk.groupChannel.getTotalUnreadMessageCount();
131131
Notifee.setBadgeCount(count);
132132
});
133-
return () => remove();
133+
return () => subscriber.remove();
134134
}, []);
135135

136136
return (

0 commit comments

Comments
 (0)