🐛 add correct verification to <Editor isUserOwner />

This commit is contained in:
ghalestrilo 2020-06-15 18:59:21 -03:00
parent 2b179194f8
commit 7f8138a204

View file

@ -79,6 +79,8 @@ Screen.propTypes = {
children: PropTypes.node.isRequired children: PropTypes.node.isRequired
}; };
const isUserOwner = ({ project, user }) => (project.owner && project.owner.id === user.id);
const IDEViewMobile = (props) => { const IDEViewMobile = (props) => {
// const // const
const { const {
@ -130,7 +132,7 @@ const IDEViewMobile = (props) => {
isExpanded={ide.sidebarIsExpanded} isExpanded={ide.sidebarIsExpanded}
expandSidebar={expandSidebar} expandSidebar={expandSidebar}
collapseSidebar={collapseSidebar} collapseSidebar={collapseSidebar}
isUserOwner={setTmController} isUserOwner={isUserOwner(props)}
clearConsole={clearConsole} clearConsole={clearConsole}
consoleEvents={console} consoleEvents={console}
showRuntimeErrorWarning={showRuntimeErrorWarning} showRuntimeErrorWarning={showRuntimeErrorWarning}
@ -247,6 +249,11 @@ IDEViewMobile.propTypes = {
hideRuntimeErrorWarning: PropTypes.func.isRequired, hideRuntimeErrorWarning: PropTypes.func.isRequired,
user: PropTypes.shape({
authenticated: PropTypes.bool.isRequired,
id: PropTypes.string,
username: PropTypes.string
}).isRequired,
}; };