fix: sweep stale export files at launch and carry quick-reply text into the composer

This commit is contained in:
Linus Rath
2026-08-29 18:41:49 +02:00
parent 8e1d03c746
commit f9ae4423e9
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -11,6 +11,7 @@ import { startLiveUpdates, type LiveUpdatesHandle } from './src/api/push-stream'
import { jmapClient } from './src/api/jmap-client';
import type { StateChange } from './src/api/types';
import { dispatchStateChange } from './src/lib/state-change-bus';
import { sweepStaleExportFiles } from './src/lib/email-export';
import { useFilterStore } from './src/stores/filter-store';
import { useVacationStore } from './src/stores/vacation-store';
import {
@@ -308,6 +309,9 @@ export default function App() {
const haveLiveSession = useAuthStore((s) => s.session != null);
React.useEffect(() => {
void useOfflineCacheStore.getState().hydrate();
// Attachments shared out of the app linger in the cache dir; drop the
// ones older than a day so a granted content URI can't read them forever.
void sweepStaleExportFiles();
}, []);
React.useEffect(() => {
if (!offlineCacheEnabled || !haveLiveSession) return;
+7 -1
View File
@@ -540,7 +540,13 @@ export default function ComposeScreen({ route, navigation }: Props) {
? `<div>${escapeHtml(prefillBody).replace(/\r?\n/g, '<br>')}</div><p><br></p>`
: '<p><br></p>';
}
return buildInitialHtml(mode, {
// Quick reply "More options" hands the typed text over as prefillBody;
// it goes above the quote.
const typed = prefillBody
? `<div>${escapeHtml(prefillBody).replace(/␍?
/g, '<br>')}</div>`
: '';
return typed + buildInitialHtml(mode, {
from: { name: replyTo.from.name, email: replyTo.from.email },
to: replyTo.to,
cc: replyTo.cc,