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:
@@ -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>
|
||||
—
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user