Task email notifications - email bugs fixes
Addresses the following issues (not tracked on GitHub)
- A user may not have any role attached against a manuscript. Hence the isEditor/isReviewer check will check for a non-null check
- There was an issue with the persistedTasks array (was happening in local) where it was giving an error as the array was readonly. Hence, added a
slice()
operator to make a copy of it. Fixed by this StackOverflow answer - Dropped the unique index set for recipient and email notification task id which was restricting a task to only have one entry for a recipient in the list of emails.