File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -203,14 +203,12 @@ export const VersionSidebar: FC = () => {
203203 thumbStartColor = "gray"
204204 >
205205 < div className = "version-sidebar--submenu-wrapper" >
206- { hasDraft && (
207- < Button
208- icon = { IconFont . ArrowLeft_New }
209- text = "Back to Current Version"
210- onClick = { handleClose }
211- className = "version-sidebar--back-btn"
212- />
213- ) }
206+ < Button
207+ icon = { IconFont . ArrowLeft_New }
208+ text = "Back to Current Version"
209+ onClick = { handleClose }
210+ className = "version-sidebar--back-btn"
211+ />
214212 < List >
215213 { trimmedVersions . map ( version => (
216214 < React . Fragment key = { version . id } >
Original file line number Diff line number Diff line change @@ -198,10 +198,13 @@ const MenuButton: FC<Props> = ({handleResetShare}) => {
198198 onClick : handleViewPublish ,
199199 icon : IconFont . History ,
200200 disabled : ( ) => {
201- if ( versions . length > 1 ) {
202- return false
201+ const [ first , second ] = versions
202+ // accounts for the draft state
203+ let versionId = first ?. id
204+ if ( first ?. id === 'draft' && second ?. id ) {
205+ versionId = second ?. id
203206 }
204- return versions [ 0 ] ?. id === 'draft'
207+ return ! ( versionId !== 'draft' && typeof versionId !== undefined )
205208 } ,
206209 } ,
207210 { title : 'divider' , type : 'divider' }
You can’t perform that action at this time.
0 commit comments