(queryKey: QueryKey, id: string)
| 176 | } |
| 177 | } else if (!feedName && shouldUseListFeedLayout) { |
| 178 | const trySetPostRead = (queryKey: QueryKey, id: string) => { |
| 179 | const updateFeedPost = updateCachedPagePost( |
| 180 | queryKey as unknown[], |
| 181 | client, |
| 182 | ); |
| 183 | |
| 184 | const data = client.getQueryData( |
| 185 | queryKey, |
| 186 | ) as InfiniteData<FeedData>; |
| 187 | |
| 188 | const { post: foundPost, page, index } = findPost(data, id); |
| 189 | if (foundPost) { |
| 190 | updateFeedPost(page, index, { |
| 191 | ...foundPost, |
| 192 | ...mutationHandler(), |
| 193 | }); |
| 194 | } |
| 195 | }; |
| 196 | |
| 197 | getFeedQueryKeys(client).forEach((key) => { |
| 198 | trySetPostRead(key, post.id); |
no test coverage detected