fix(ui): revert-to-published button showing on new drafts (#13897)

### What?

Hide the "**Revert to published**" button when creating a new draft that
has never been published.

### Why?

Previously, the button was visible on new drafts, which was confusing
because there was no published version to revert to.

### How?

Updated the revert button condition to also require `hasPublishedDoc`.
This commit is contained in:
Patrik
2025-09-22 15:07:57 -04:00
committed by GitHub
parent 66f5d1429d
commit 82d98ab375

View File

@@ -198,8 +198,10 @@ export const Status: React.FC = () => {
/>
</React.Fragment>
)}
{((!isTrashed && canUpdate && statusToRender === 'changed') ||
statusToRender === 'draft') && (
{!isTrashed &&
canUpdate &&
hasPublishedDoc &&
(statusToRender === 'changed' || statusToRender === 'draft') && (
<React.Fragment>
&nbsp;&mdash;&nbsp;
<Button