🐛 Fixed Post History for posts sent as an email (#16999)

refs https://github.com/TryGhost/Team/issues/3458

From the discussion in slack, for all published/sent posts:
  Published only --> view history & restore
  Published & sent --> view history & restore
  Email only --> history hidden

And for all unpublished/unsent posts:
  All states --> view history & restore.
This commit is contained in:
Fabien 'egg' O'Carroll 2023-06-13 12:38:39 +02:00 committed by Daniel Lockyer
parent e990bf5a94
commit 8cb8b84786
No known key found for this signature in database

View File

@ -145,14 +145,22 @@ export default class GhPostSettingsMenu extends Component {
}
get canViewPostHistory() {
let showPostHistory = this.post.lexical !== null
&& this.post.emailOnly === false;
if (this.post.isPublished === true) {
return showPostHistory && this.post.hasEmail === false;
// Can only view history for lexical posts
if (this.post.lexical === null) {
return false;
}
return showPostHistory;
// Can view history for all unpublished/unsent posts
if (!this.post.isPublished && !this.post.isSent) {
return true;
}
// Cannot view history for published posts if there isn't a web version
if (this.post.emailOnly) {
return false;
}
return true;
}
willDestroyElement() {