MCPcopy Create free account
hub / github.com/dailydotdev/apps / getPostPosition

Function getPostPosition

packages/shared/src/hooks/usePostModalNavigation.ts:215–226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 1

usePostModalNavigationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected