Added admin to the shared context

This commit is contained in:
Simon Backx 2022-07-06 10:12:16 +02:00
parent 8aebf187f9
commit d5c98b1002
2 changed files with 4 additions and 2 deletions

View File

@ -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,

View File

@ -17,7 +17,7 @@ class CommentContextMenu extends React.Component {
}
get isAdmin() {
return false;
return !!this.context.admin;
}
render() {