@@ -29,7 +29,7 @@ export class GitHubAddCommentEnhancer implements CommentEnhancer<GitHubAddCommen
2929 return [ ...GITHUB_SPOT_TYPES ]
3030 }
3131
32- tryToEnhance ( textarea : HTMLTextAreaElement ) : [ OverTypeInstance , GitHubAddCommentSpot ] | null {
32+ tryToEnhance ( _textarea : HTMLTextAreaElement ) : GitHubAddCommentSpot | null {
3333 // Only handle github.com domains TODO: identify GitHub Enterprise somehow
3434 if ( window . location . hostname !== 'github.com' ) {
3535 return null
@@ -44,22 +44,22 @@ export class GitHubAddCommentEnhancer implements CommentEnhancer<GitHubAddCommen
4444 const [ , owner , repo , numberStr ] = match
4545 const slug = `${ owner } /${ repo } `
4646 const number = parseInt ( numberStr ! , 10 )
47-
4847 const unique_key = `github.com:${ slug } :${ number } `
49-
50- const spot : GitHubAddCommentSpot = {
48+ return {
5149 domain : 'github.com' ,
5250 number,
5351 slug,
5452 type : 'GH_PR_ADD_COMMENT' ,
5553 unique_key,
5654 }
57- return [ this . createOvertypeFor ( textarea ) , spot ]
5855 }
5956
60- private createOvertypeFor ( ghCommentBox : HTMLTextAreaElement ) : OverTypeInstance {
57+ prepareForFirstEnhancement ( ) : void {
6158 OverType . setCodeHighlighter ( hljsHighlighter )
62- const overtypeContainer = this . modifyDOM ( ghCommentBox )
59+ }
60+
61+ enhance ( textArea : HTMLTextAreaElement , _spot : GitHubAddCommentSpot ) : OverTypeInstance {
62+ const overtypeContainer = this . modifyDOM ( textArea )
6363 return new OverType ( overtypeContainer , {
6464 autoResize : true ,
6565 minHeight : '102px' ,
0 commit comments