From 2846eec88128bf1ad97db4eb34ac30e146031d76 Mon Sep 17 00:00:00 2001 From: Herman Wikner Date: Mon, 2 Jan 2023 15:18:24 +0100 Subject: [PATCH] fix(desk): remove restore action when revision is latest version --- .../sanity/src/desk/documentActions/HistoryRestoreAction.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/sanity/src/desk/documentActions/HistoryRestoreAction.tsx b/packages/sanity/src/desk/documentActions/HistoryRestoreAction.tsx index 0c7d15eaf80..ad52381d11a 100644 --- a/packages/sanity/src/desk/documentActions/HistoryRestoreAction.tsx +++ b/packages/sanity/src/desk/documentActions/HistoryRestoreAction.tsx @@ -34,6 +34,11 @@ export const HistoryRestoreAction: DocumentActionComponent = ({id, type, revisio }, [handleConfirm, isConfirmDialogOpen, onComplete]) const isRevisionInitialVersion = revision === '@initial' + const isRevisionLatestVersion = revision === undefined // undefined means latest version + + if (isRevisionLatestVersion) { + return null + } return { label: 'Restore',