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): Marking email as seen not updating in soup (#804)

dev-rbed4a43e180f1
diff --git a/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx b/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx
index 71ad199d48..9b6d1c726a 100644
--- a/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx
+++ b/js/app/packages/notifications/components/DebouncedNotificationReadMarker.tsx
@@ -1,4 +1,5 @@
import type { Entity } from '@core/types';
+import { queryClient } from '@queries/client';
import { useMarkThreadAsSeenMutation } from '@queries/email/thread';
import { onCleanup, onMount } from 'solid-js';
import {
@@ -110,19 +111,20 @@ export function EmailDebouncedReadMarker(props: {
debounceTime?: number;
threadId: string;
}) {
- const markSeenMutation = useMarkThreadAsSeenMutation();
+ const markSeenMutation = useMarkThreadAsSeenMutation({
+ onSuccess() {
+ queryClient.invalidateQueries({
+ predicate(query) {
+ return query.queryKey.includes('dss');
+ },
+ });
+ },
+ });
return (
<DebouncedMarker
debounceTime={props.debounceTime}
- debouncedFn={() => {
- const hasUnreadNotification = props.notificationSource
- .notifications()
- .find((e) => e.entity_id === props.threadId);
- if (!hasUnreadNotification) return;
-
- markSeenMutation.mutate({ threadId: props.threadId });
- }}
+ debouncedFn={() => markSeenMutation.mutate({ threadId: props.threadId })}
/>
);
}