Skip to content
Merged

Staging #1029

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions apps/mail/components/party.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ export const NotificationProvider = ({ headers }: { headers: Record<string, stri
// await refetchThreads();
// }, [refetchThreads]);

const labelsDebouncer = funnel(refetchLabels, { minQuietPeriodMs: DEBOUNCE_DELAY });
const threadsDebouncer = funnel(refetchThreads, { minQuietPeriodMs: DEBOUNCE_DELAY });
const labelsDebouncer = funnel(
() => queryClient.invalidateQueries({ queryKey: trpc.labels.list.queryKey() }),
{ minQuietPeriodMs: DEBOUNCE_DELAY },
);
const threadsDebouncer = funnel(
() => queryClient.invalidateQueries({ queryKey: trpc.mail.listThreads.queryKey() }),
{ minQuietPeriodMs: DEBOUNCE_DELAY },
);

usePartySocket({
party: 'durable-mailbox',
Expand Down
2 changes: 2 additions & 0 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"mimetext": "^3.0.27",
"p-retry": "6.2.1",
"partyserver": "^0.0.71",
"react": "19.0.0",
"remeda": "2.21.3",
"resend": "^4.5.1",
"sanitize-html": "^2.16.0",
Expand All @@ -56,6 +57,7 @@
"devDependencies": {
"@types/he": "1.2.3",
"@types/node": "^22.9.0",
"@types/react": "19.0.10",
"@types/sanitize-html": "2.13.0",
"typescript": "catalog:"
}
Expand Down
9 changes: 8 additions & 1 deletion apps/server/src/lib/sanitize-tip-tap-html.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import { Html } from '@react-email/components';
import { render } from '@react-email/render';
import sanitizeHtml from 'sanitize-html';
import React from 'react';

export const sanitizeTipTapHtml = async (html: string) => {
const clean = sanitizeHtml(html);
return render(Html({ dangerouslySetInnerHTML: { __html: clean } }));
return render(
React.createElement(
Html,
{},
React.createElement('div', { dangerouslySetInnerHTML: { __html: clean } }),
),
);
};
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.