Skip to content

Commit 7f8138a

Browse files
committed
🐛 add correct verification to <Editor isUserOwner />
1 parent 2b17919 commit 7f8138a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/modules/IDE/pages/IDEViewMobile.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ Screen.propTypes = {
7979
children: PropTypes.node.isRequired
8080
};
8181

82+
const isUserOwner = ({ project, user }) => (project.owner && project.owner.id === user.id);
83+
8284
const IDEViewMobile = (props) => {
8385
// const
8486
const {
@@ -130,7 +132,7 @@ const IDEViewMobile = (props) => {
130132
isExpanded={ide.sidebarIsExpanded}
131133
expandSidebar={expandSidebar}
132134
collapseSidebar={collapseSidebar}
133-
isUserOwner={setTmController}
135+
isUserOwner={isUserOwner(props)}
134136
clearConsole={clearConsole}
135137
consoleEvents={console}
136138
showRuntimeErrorWarning={showRuntimeErrorWarning}
@@ -247,6 +249,11 @@ IDEViewMobile.propTypes = {
247249

248250
hideRuntimeErrorWarning: PropTypes.func.isRequired,
249251

252+
user: PropTypes.shape({
253+
authenticated: PropTypes.bool.isRequired,
254+
id: PropTypes.string,
255+
username: PropTypes.string
256+
}).isRequired,
250257
};
251258

252259

0 commit comments

Comments
 (0)