mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Prevented post history from being viewed for emailed posts (#16704)
refs https://github.com/orgs/TryGhost/projects/88/views/2?pane=issue&itemId=26198422 Prevented post history from being viewed in the following scenarios: - When a post is sent as and email only - When a post is published and sent as an email
This commit is contained in:
parent
6aa8fa2a8e
commit
b60761706b
2 changed files with 13 additions and 1 deletions
|
@ -149,7 +149,7 @@
|
|||
</div>
|
||||
</li>
|
||||
{{/unless}}
|
||||
{{#if (and (feature 'postHistory') this.post.lexical)}}
|
||||
{{#if this.canViewPostHistory}}
|
||||
<li class="nav-list-item">
|
||||
<button type="button" {{on "click" this.openPostHistory}} data-test-toggle="post-history">
|
||||
<span>{{svg-jar "history" class="history"}} Post history</span>
|
||||
|
|
|
@ -144,6 +144,18 @@ export default class GhPostSettingsMenu extends Component {
|
|||
return urlParts.join(' › ');
|
||||
}
|
||||
|
||||
get canViewPostHistory() {
|
||||
let showPostHistory = this.feature.postHistory === true
|
||||
&& this.post.lexical !== null
|
||||
&& this.post.emailOnly === false;
|
||||
|
||||
if (this.post.isPublished === true) {
|
||||
showPostHistory = this.post.hasEmail === false;
|
||||
}
|
||||
|
||||
return showPostHistory;
|
||||
}
|
||||
|
||||
willDestroyElement() {
|
||||
super.willDestroyElement(...arguments);
|
||||
|
||||
|
|
Loading…
Reference in a new issue