(user: QueryUser, peerId: string)
| 323 | // Whether the peer is typing right now. Live updates set it and nothing |
| 324 | // fetches it, so it starts false and only a reconnect resets it. |
| 325 | export const dmTypingQueryOptions = (user: QueryUser, peerId: string) => |
| 326 | queryOptions<boolean>({ |
| 327 | queryKey: generateQueryKey(RequestKey.DirectMessages, user, 'typing', { |
| 328 | peerId, |
| 329 | }), |
| 330 | queryFn: () => false, |
| 331 | initialData: false, |
| 332 | staleTime: Infinity, |
| 333 | enabled: !!user?.id && !!peerId, |
| 334 | }); |
| 335 | |
| 336 | // A peer we already talk to comes from the conversation; anyone else, such as |
| 337 | // a profile's "Message" button, is looked up as a regular daily.dev user. |
no test coverage detected