Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(email-service): Always call /seen endpoint when opening thread (#1249)

Evan Hutnik8b03a1e6d2d7
diff --git a/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx b/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx
index ab53e8b0bb..0fada77d27 100644
--- a/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx
+++ b/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx
@@ -1,6 +1,4 @@
import type { Entity } from '@core/types';
-import { queryClient } from '@queries/client';
-import { emailKeys } from '@queries/email/keys';
import { useMarkThreadAsSeenMutation } from '@queries/email/thread';
import { onMount } from 'solid-js';
import {
@@ -136,21 +134,10 @@ export function EmailDebouncedReadMarker(props: {
}) {
const markSeenMutation = useMarkThreadAsSeenMutation();
- const isAlreadySeen = () => {
- const data = queryClient.getQueryData(
- emailKeys.threadMessages(props.threadId).queryKey
- );
- return (
- (data as { pages?: { is_read?: boolean }[] })?.pages?.[0]?.is_read ===
- true
- );
- };
-
return (
<DebouncedMarker
debounceTime={props.debounceTime}
debouncedFn={() => {
- if (isAlreadySeen()) return;
markSeenMutation.mutate({ threadId: props.threadId });
}}
/>