Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
fix: remove pin from element even if element does not have the specif…
Browse files Browse the repository at this point in the history
…ied data-attribute
  • Loading branch information
Raspincel committed Jan 8, 2024
1 parent d6b5922 commit 2ed4924
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/comments/html-pin-adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,16 @@ export class HTMLPin implements PinAdapter {
public removeAnnotationPin(uuid: string): void {
const pinElement = this.pins.get(uuid);

if (!pinElement) return;
if (!pinElement && uuid === 'temporary-pin') return;

pinElement.remove();
this.pins.delete(uuid);
this.annotations = this.annotations.filter((annotation) => annotation.uuid !== uuid);
if (pinElement) {
pinElement.remove();
this.pins.delete(uuid);
}

this.annotations = this.annotations.filter((annotation) => {
return annotation.uuid !== uuid;
});
}

/**
Expand Down

0 comments on commit 2ed4924

Please sign in to comment.