Reload even when there is an unsent draft
Holding the reload back while a compose window had unsaved text protected the text, but it meant a tab could sit on a build the server no longer runs for as long as someone left a draft open -- which is not automatic, and automatic is the point. So the reload is unconditional once the versions differ, and this will sometimes take an unsent draft with it. The trade is deliberate: a tab talking to a server it does not match is the worse failure, and it fails quietly.
This commit is contained in:
1 parent
fedd6ed161
commit
8f9d253939
3 files changed
+11
-62
No files matched your search
@@ -10,7 +10,6 @@ import { useMail, FULL_PROPS, BODY_PROPS } from "./mail";
|
||||
import { ensureScheduledMailbox, useScheduled } from "./scheduled";
|
||||
import { formatScheduleTime, holdUntil } from "@/lib/schedule";
|
||||
import { settings } from "./settings";
|
||||
import { holdReloadWhile } from "@/lib/staleBuild";
|
||||
|
||||
export interface ComposeAttachment {
|
||||
id: string;
|
||||
@@ -808,8 +807,3 @@ export function draftFromMailto(url: string): Partial<Draft> {
|
||||
...(body ? { html: body, text: m.body } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
// A deploy can reload this tab out from under whoever is writing. Text that has
|
||||
// not been autosaved lives only here, and once the session is gone it cannot be
|
||||
// saved at all -- so say so, and let them sign in and send it instead.
|
||||
holdReloadWhile(() => useCompose.getState().drafts.some((d) => d.dirty));
|
||||
Reference in new issue
Block a user