Fix onViewableItemsChanged
This commit is contained in:
parent
2ba7bda0b9
commit
03dd4477da
4 changed files with 8 additions and 8 deletions
|
|
@ -195,8 +195,8 @@ const PostList = ({
|
|||
}
|
||||
|
||||
const viewableItemsMap = viewableItems.reduce((acc: Record<string, boolean>, {item, isViewable}) => {
|
||||
if (isViewable) {
|
||||
acc[`${location}-${item.id}`] = true;
|
||||
if (isViewable && item.type === 'post') {
|
||||
acc[`${location}-${item.value.id}`] = true;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ const RecentMentionsScreen = ({appsEnabled, customEmojiNames, mentions, currentT
|
|||
}
|
||||
|
||||
const viewableItemsMap = viewableItems.reduce((acc: Record<string, boolean>, {item, isViewable}) => {
|
||||
if (isViewable) {
|
||||
acc[`${Screens.MENTIONS}-${item.id}`] = true;
|
||||
if (isViewable && item.type === 'post') {
|
||||
acc[`${Screens.MENTIONS}-${item.value.id}`] = true;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ function SavedMessages({appsEnabled, posts, currentTimezone, customEmojiNames, i
|
|||
}
|
||||
|
||||
const viewableItemsMap = viewableItems.reduce((acc: Record<string, boolean>, {item, isViewable}) => {
|
||||
if (isViewable) {
|
||||
acc[`${Screens.SAVED_MESSAGES}-${item.id}`] = true;
|
||||
if (isViewable && item.type === 'post') {
|
||||
acc[`${Screens.SAVED_MESSAGES}-${item.value.id}`] = true;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ function SavedMessages({
|
|||
}
|
||||
|
||||
const viewableItemsMap = viewableItems.reduce((acc: Record<string, boolean>, {item, isViewable}) => {
|
||||
if (isViewable) {
|
||||
acc[`${Screens.PINNED_MESSAGES}-${item.id}`] = true;
|
||||
if (isViewable && item.type === 'post') {
|
||||
acc[`${Screens.PINNED_MESSAGES}-${item.value.id}`] = true;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
|
|
|
|||
Loading…
Reference in a new issue