File tree 2 files changed +4
-3
lines changed 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,15 @@ const thumbsDownIcon = (
45
45
) ;
46
46
47
47
function sendGAEvent ( isPositive : boolean ) {
48
+ const category = isPositive ? 'like_button' : 'dislike_button' ;
48
49
const value = isPositive ? 1 : 0 ;
49
50
// Fragile. Don't change unless you've tested the network payload
50
51
// and verified that the right events actually show up in GA.
51
52
// @ts -ignore
52
53
gtag ( 'event' , 'feedback' , {
53
- event_category : 'button' ,
54
+ event_category : category ,
54
55
event_label : window . location . pathname ,
55
- value,
56
+ event_value : value ,
56
57
} ) ;
57
58
}
58
59
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export default function App() {
116
116
]);
117
117
async function sendMessage (formData ) {
118
118
const sentMessage = await deliverMessage (formData .get (" message" ));
119
- setMessages ([... messages, { text: sentMessage }]);
119
+ setMessages (( messages ) => [... messages, { text: sentMessage }]);
120
120
}
121
121
return < Thread messages= {messages} sendMessage= {sendMessage} / > ;
122
122
}
You can’t perform that action at this time.
0 commit comments