Skip to content

Commit

Permalink
Update CATcher version to v3.4.3-hotfix (#1006)
Browse files Browse the repository at this point in the history
Fix image uploads not working
  • Loading branch information
kkangs0226 authored Oct 2, 2022
1 parent 03fa6c8 commit 8ba9b04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/shared/comment-editor/upload-text-insertor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function replacePlaceholderString(
commentField: AbstractControl,
commentTextArea: ElementRef<HTMLTextAreaElement>
) {
const cursorPosition = this.commentTextArea.nativeElement.selectionEnd;
const cursorPosition = commentTextArea.nativeElement.selectionEnd;
const insertingString = `[Uploading ${filename}...]`;
const startIndexOfString = this.commentField.value.indexOf(insertingString);
const startIndexOfString = commentField.value.indexOf(insertingString);
const endIndexOfString = startIndexOfString + insertingString.length;
const endOfInsertedString = startIndexOfString + insertedString.length;
const differenceInLength = endOfInsertedString - endIndexOfString;
Expand All @@ -78,6 +78,6 @@ function replacePlaceholderString(
? cursorPosition
: cursorPosition + differenceInLength; // after the uploading text

commentField.setValue(this.commentField.value.replace(insertingString, insertedString));
commentField.setValue(commentField.value.replace(insertingString, insertedString));
commentTextArea.nativeElement.setSelectionRange(newCursorPosition, newCursorPosition);
}

0 comments on commit 8ba9b04

Please sign in to comment.