Remove unnecessary array filter
Remove a filter callback which always returned true. The first `!ann.id` condition is already part of the `store.unsavedAnnotations` logic. The second `isHighlight(...)` check did not work properly because the input was an annotation stub object with only `id` and `$tag` fields instead of the `Annotation` that `isHighlight` expects. For annotation stubs with no id, it always returned false. From a functional perspective the `isHighlight` check was also unnecessary. `store.unsavedAnnotations()` only returns IDs of annotations which have active drafts, but for highlights no draft is created.
Showing
Please register or sign in to comment