diff --git a/app/scenes/Document/components/Document.tsx b/app/scenes/Document/components/Document.tsx index 02d23b40d..935056f24 100644 --- a/app/scenes/Document/components/Document.tsx +++ b/app/scenes/Document/components/Document.tsx @@ -466,9 +466,20 @@ class DocumentScene extends React.Component { !this.isUploading && !team?.collaborativeEditing } - message={t( - `You have unsaved changes.\nAre you sure you want to discard them?` - )} + message={(location, action) => { + if ( + // a URL replace matching the current document indicates a title change + // no guard is needed for this transition + action === "REPLACE" && + location.pathname === editDocumentUrl(document) + ) { + return true; + } + + return t( + `You have unsaved changes.\nAre you sure you want to discard them?` + ) as string; + }} />