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): Debounce times for /seen endpoint call (#1797)

Evan Hutnikc7cbed597558
diff --git a/js/app/packages/block-email/component/Block.tsx b/js/app/packages/block-email/component/Block.tsx
index 9fb9feb742..91b8a76af0 100644
--- a/js/app/packages/block-email/component/Block.tsx
+++ b/js/app/packages/block-email/component/Block.tsx
@@ -1,4 +1,5 @@
import { useGlobalNotificationSource } from '@app/component/GlobalAppState';
+import { useMaybePreviewPanel } from '@app/component/PreviewPanel';
import { withAnalytics } from '@coparse/analytics';
import { DocumentBlockContainer } from '@core/component/DocumentBlockContainer';
import { EmailDebouncedReadMarker } from '@notifications';
@@ -12,6 +13,7 @@ const { track, TrackingEvents } = withAnalytics();
export default function BlockEmail() {
const blockData = blockDataSignal.get;
const notificationSource = useGlobalNotificationSource();
+ const isPreview = !!useMaybePreviewPanel();
const threadId = createMemo(() => blockData()?.thread?.db_id ?? '');
@@ -42,6 +44,7 @@ export default function BlockEmail() {
<EmailDebouncedReadMarker
notificationSource={notificationSource}
threadId={id()}
+ debounceTime={isPreview ? 1_500 : 100}
/>
<Suspense>
<EmailView title={title()} threadId={id} />