mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 12:53:13 +03:00
Added admin to the shared context
This commit is contained in:
parent
8aebf187f9
commit
d5c98b1002
@ -58,6 +58,7 @@ export default class App extends React.Component {
|
||||
action: 'init:running',
|
||||
initStatus: 'running',
|
||||
member: null,
|
||||
admin: null,
|
||||
comments: null,
|
||||
pagination: null,
|
||||
popupNotification: null,
|
||||
@ -262,12 +263,13 @@ export default class App extends React.Component {
|
||||
|
||||
/**Get final App level context from App state*/
|
||||
getContextFromState() {
|
||||
const {action, popupNotification, customSiteUrl, member, comments, pagination, postId} = this.state;
|
||||
const {action, popupNotification, customSiteUrl, member, comments, pagination, postId, admin} = this.state;
|
||||
return {
|
||||
action,
|
||||
popupNotification,
|
||||
customSiteUrl,
|
||||
member,
|
||||
admin,
|
||||
comments,
|
||||
pagination,
|
||||
postId,
|
||||
|
@ -17,7 +17,7 @@ class CommentContextMenu extends React.Component {
|
||||
}
|
||||
|
||||
get isAdmin() {
|
||||
return false;
|
||||
return !!this.context.admin;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
Loading…
Reference in New Issue
Block a user