Skip to content

Commit a77f04f

Browse files
committed
Only show enter token button if no invitations are present
1 parent 36e4f00 commit a77f04f

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎ui/scripts/projects.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,22 @@
904904
label: 'Enter Token',
905905
isHeader: true,
906906
addRow: false,
907+
preFilter: function(args) {
908+
var invitationsPresent = false;
909+
910+
$.ajax({
911+
url: createURL('listProjectInvitations'),
912+
data: { state: 'Pending' },
913+
async: false,
914+
success: function(json) {
915+
if (json.listprojectinvitationsresponse.count) {
916+
invitationsPresent = true;
917+
}
918+
}
919+
});
920+
921+
return !invitationsPresent;
922+
},
907923
createForm: {
908924
desc: 'Please enter the token that you were given in your invite e-mail.',
909925
fields: {

0 commit comments

Comments
 (0)