You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.
The code currently uses the filter() function on an array, which will return all drafts that match the draft subject line entered, but always selects the first draft in the filtered array anyway:
The filter function takes forever if there are any significant number of draft emails because it looks for all messages that match, which requires looking through every draft message the user has. Instead, since we only draft we care about the first match found (as demonstrated by the "[0]" above), I think you can use the find() function instead and speed things up dramatically:
The code currently uses the filter() function on an array, which will return all drafts that match the draft subject line entered, but always selects the first draft in the filtered array anyway:
const draft = drafts.filter(subjectFilter_(subject_line))[0];
The filter function takes forever if there are any significant number of draft emails because it looks for all messages that match, which requires looking through every draft message the user has. Instead, since we only draft we care about the first match found (as demonstrated by the "[0]" above), I think you can use the find() function instead and speed things up dramatically:
const draft = drafts.find(subjectFilter_(subject_line));
The text was updated successfully, but these errors were encountered: