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

Function isFinalViewRejection

packages/shared/src/lib/streakViewQueue.ts:85–93  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

83];
84
85export const isFinalViewRejection = (error: unknown): boolean => {
86 const errors = (error as Partial<ResponseError>)?.response?.errors;
87 const finalCodes = getFinalViewRejectionCodes();
88
89 return (
90 Array.isArray(errors) &&
91 errors.some((item) => finalCodes.includes(item?.extensions?.code as string))
92 );
93};
94
95// viewPost takes no read time: the API credits a replayed view to the moment
96// it arrives. Only a view from the same local day lands on the day it was

Callers 3

useViewPostFunction · 0.90
sendQueuedViewsFunction · 0.85

Calls 1

Tested by

no test coverage detected