Initialize `target` property of new page notes to a single-item array
Annotations received from the API always have a non-empty `target` array, as do annotations and replies created locally that have not yet been saved. Unsaved Page Notes were an exception. This led to an error [1] when hovering a new unsaved page note in a VitalSource book, due to code not handling an empty `target` array. Resolve this by initializing the `target` field of new page notes in the same way as replies and annotations (minus the `selector` property that annotations have). [1] https://hypothesis.sentry.io/issues/3745569320/
Showing
Please register or sign in to comment