From 93f60d58f93c4ffea9ccb652c0b0d78b56370bcf Mon Sep 17 00:00:00 2001 From: "Jonathan (JB) Belcher" Date: Tue, 28 Jul 2020 16:27:48 -0400 Subject: [PATCH] Clean up disable restore note button when is newset revision --- lib/revision-selector/index.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/revision-selector/index.tsx b/lib/revision-selector/index.tsx index bc727f1a3..3e3df8b9e 100644 --- a/lib/revision-selector/index.tsx +++ b/lib/revision-selector/index.tsx @@ -36,7 +36,6 @@ export class RevisionSelector extends Component { onAcceptRevision = () => { const { noteId, openedRevision, restoreRevision } = this.props; - restoreRevision(noteId, openedRevision); }; @@ -66,7 +65,9 @@ export class RevisionSelector extends Component { revisions && openedRevision ? [...revisions.keys()].indexOf(openedRevision) : -1; - const isNewest = openedRevision && selectedIndex === revisions?.size - 1; + const isNewest = + !openedRevision || + (openedRevision && selectedIndex === revisions?.size - 1); const revisionDate = format( (openedRevision @@ -75,10 +76,6 @@ export class RevisionSelector extends Component { 'MMM d, yyyy h:mm a' ); - const revisionButtonStyle: CSSProperties = isNewest - ? { opacity: '0.5', pointerEvents: 'none' } - : {}; - const mainClasses = classNames('revision-selector', { 'is-visible': isViewingRevisions, }); @@ -105,7 +102,7 @@ export class RevisionSelector extends Component { Cancel