()
| 213 | }; |
| 214 | |
| 215 | const getPostPosition = () => { |
| 216 | const firstPost = items.findIndex(isPostItem); |
| 217 | const isLast = items.length - 1 === openedPostIndex; |
| 218 | if (firstPost === openedPostIndex) { |
| 219 | return items.length - 1 === openedPostIndex |
| 220 | ? PostPosition.Only |
| 221 | : PostPosition.First; |
| 222 | } |
| 223 | return (!canFetchMore || isFetchingNextPage) && isLast |
| 224 | ? PostPosition.Last |
| 225 | : PostPosition.Middle; |
| 226 | }; |
| 227 | |
| 228 | useEffect(() => { |
| 229 | if (!isNavigationActive) { |
no outgoing calls
no test coverage detected