Skip to content

Commit 97c8f15

Browse files
committed
Minimize diff.
1 parent 10eff91 commit 97c8f15

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

browser-extension/src/entrypoints/content.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ const enhancedTextareas = new TextareaRegistry()
99
// Expose for debugging in har:view
1010
;(window as any).gitcassoTextareaRegistry = enhancedTextareas
1111

12-
function sendEventToBackground(
13-
type: 'ENHANCED' | 'DESTROYED',
14-
spot: CommentSpot,
15-
textarea?: HTMLTextAreaElement,
16-
): void {
12+
function sendEventToBackground(type: 'ENHANCED' | 'DESTROYED', spot: CommentSpot): void {
1713
const message: CommentEvent = {
1814
spot,
1915
type,
@@ -25,7 +21,7 @@ function sendEventToBackground(
2521
}
2622

2723
enhancedTextareas.setEventHandlers(
28-
(spot, textarea) => sendEventToBackground('ENHANCED', spot, textarea),
24+
(spot) => sendEventToBackground('ENHANCED', spot),
2925
(spot) => sendEventToBackground('DESTROYED', spot),
3026
)
3127

browser-extension/src/lib/registries.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ export class EnhancerRegistry {
105105

106106
export class TextareaRegistry {
107107
private textareas = new Map<HTMLTextAreaElement, EnhancedTextarea>()
108-
private onEnhanced?: (spot: CommentSpot, textarea: HTMLTextAreaElement) => void
108+
private onEnhanced?: (spot: CommentSpot) => void
109109
private onDestroyed?: (spot: CommentSpot) => void
110110

111111
setEventHandlers(
112-
onEnhanced: (spot: CommentSpot, textarea: HTMLTextAreaElement) => void,
112+
onEnhanced: (spot: CommentSpot) => void,
113113
onDestroyed: (spot: CommentSpot) => void,
114114
): void {
115115
this.onEnhanced = onEnhanced
@@ -118,7 +118,7 @@ export class TextareaRegistry {
118118

119119
register<T extends CommentSpot>(textareaInfo: EnhancedTextarea<T>): void {
120120
this.textareas.set(textareaInfo.textarea, textareaInfo)
121-
this.onEnhanced?.(textareaInfo.spot, textareaInfo.textarea)
121+
this.onEnhanced?.(textareaInfo.spot)
122122
}
123123

124124
unregisterDueToModification(textarea: HTMLTextAreaElement): void {

0 commit comments

Comments
 (0)