Skip to content

Commit

Permalink
[desk-tool] Disable restore document button when selecting the initia…
Browse files Browse the repository at this point in the history
…l document revision (empty document)
  • Loading branch information
saasen authored and rexxars committed Oct 6, 2020
1 parent d84e2d3 commit ca0f6e7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,17 @@ export function HistoryRestoreAction({id, type, revision, onComplete}) {
}
}, [error, handleConfirm, isConfirmDialogOpen, onComplete])

const isRevisionInitialVersion = revision === '@initial'

return {
label: 'Restore',
color: 'primary',
onHandle: handle,
title: 'Restore to this version',
title: isRevisionInitialVersion
? "You can't restore to the initial version"
: 'Restore to this version',
icon: HistoryIcon,
dialog
dialog,
disabled: isRevisionInitialVersion
}
}

0 comments on commit ca0f6e7

Please sign in to comment.