mirror of
https://github.com/bulwarkmail/native.git
synced 2026-10-31 16:06:32 +00:00
fix: sweep stale export files at launch and carry quick-reply text into the composer
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user