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): Email draft not displaying when moving between soup and email (#808)

dev-rb61d5e689f68c
diff --git a/js/app/packages/block-email/component/BaseInput.tsx b/js/app/packages/block-email/component/BaseInput.tsx
index 51d7e5a47d..83b7645f49 100644
--- a/js/app/packages/block-email/component/BaseInput.tsx
+++ b/js/app/packages/block-email/component/BaseInput.tsx
@@ -188,6 +188,7 @@ export function BaseInput(props: {
});
pendingMentions = [];
await deleteDraftAndReset();
+ refetchThreadMessages();
props.sideEffectOnSend?.(message.db_id ?? null);
if (shouldMarkDoneOnSuccess()) {
props.onMarkDone?.();
@@ -199,6 +200,10 @@ export function BaseInput(props: {
},
});
+ function refetchThreadMessages() {
+ ctx.query.refetch();
+ }
+
// Attach side-effect handlers on mount; they replay against current state
onMount(() => {
form().setOnDirty(() => {
@@ -277,6 +282,7 @@ export function BaseInput(props: {
const draftId = savedDraftId();
if (draftId) {
await deleteEmailDraft(draftId);
+ refetchThreadMessages();
}
setSavedDraftId(undefined);
return;
@@ -328,6 +334,7 @@ export function BaseInput(props: {
if (draftResponse) {
setSavedDraftId(draftResponse);
}
+ refetchThreadMessages();
}
function scheduleDraftSave() {
@@ -503,6 +510,7 @@ export function BaseInput(props: {
const draftId = savedDraftId();
if (draftId) {
await deleteEmailDraft(draftId);
+ refetchThreadMessages();
}
const replyingToId = props.replyingTo()?.db_id;
if (replyingToId) {