FriendsOfFlarum / doorman

🚪 Only allow certain people to join your forum
MIT License
24 stars 15 forks source link

Can't send invite emails with maxUses == 0 #28

Closed franga2000 closed 1 year ago

franga2000 commented 3 years ago

When "Max Uses" for an invite is set to 0, which is supposed to mean unlimited, the "Send Invite Codes" modal doesn't let you add any emails to its list.

The culprit seems to be the if statement in the following snippet, as it will always succeed if maxUses == 0 and therefore not add the email to the list. https://github.com/FriendsOfFlarum/doorman/blob/57a3498f7b270af8c99a3523a02097282f2e8b61/js/src/admin/components/InviteCodeModal.js#L98-L100

Curiously enough, for me at least (on Firefox 81), the alert that is supposed to show up isn't seen either, so there is no indicator of anything being wrong (besides it, well, not working).

EDIT: I'm running beta14- branch so, so the alert problem might be related to that, but the core issue can't be as the relevant code is the same as in master.