@@ -55,19 +55,19 @@ class ProjectEditor extends Component {
55
55
}
56
56
}
57
57
58
- getMemberRole ( members , handle ) {
59
- if ( ! handle ) { return null }
58
+ getMemberRole ( members , userId ) {
59
+ if ( ! userId ) { return null }
60
60
61
61
const found = _ . find ( members , ( m ) => {
62
- return m . handle === handle
62
+ return m . userId === userId
63
63
} )
64
64
65
65
return _ . get ( found , 'role' )
66
66
}
67
67
68
- checkIsCopilotOrManager ( projectMembers , handle ) {
68
+ checkIsCopilotOrManager ( projectMembers , userId ) {
69
69
if ( projectMembers && projectMembers . length > 0 ) {
70
- const role = this . getMemberRole ( projectMembers , handle )
70
+ const role = this . getMemberRole ( projectMembers , userId )
71
71
return role === PROJECT_ROLES . COPILOT || role === PROJECT_ROLES . MANAGER
72
72
} else {
73
73
return false
@@ -91,7 +91,7 @@ class ProjectEditor extends Component {
91
91
if ( isProjectTypesLoading || ( isEdit && isProjectLoading ) ) return < Loader />
92
92
93
93
const isAdmin = checkAdmin ( this . props . auth . token )
94
- const isCopilotOrManager = this . checkIsCopilotOrManager ( _ . get ( projectDetail , 'members' , [ ] ) , _ . get ( this . props . auth , 'user.handle ' , null ) )
94
+ const isCopilotOrManager = this . checkIsCopilotOrManager ( _ . get ( projectDetail , 'members' , [ ] ) , _ . get ( this . props . auth , 'user.userId ' , null ) )
95
95
const canManage = isAdmin || isCopilotOrManager
96
96
97
97
const projectId = this . getProjectId ( match )
0 commit comments