Merge pull request #10797 from overleaf/td-editor-toggle-analytics

Add analytics for switching editor

GitOrigin-RevId: 7b44e53105e8669e97cb9c4821dfbc830faff779
This commit is contained in:
Tim Down 2022-12-06 14:51:47 +00:00 committed by Copybot
parent 04d0eabb32
commit fa67c3fcff

View file

@ -1,6 +1,7 @@
import { memo, useCallback } from 'react'
import useScopeValue from '../../../shared/hooks/use-scope-value'
import Tooltip from '../../../shared/components/tooltip'
import { sendMB } from '../../../infrastructure/event-tracking'
function Badge() {
const content = (
@ -43,9 +44,9 @@ function EditorSwitch() {
const handleChange = useCallback(
event => {
const choice = event.target.value
const editorType = event.target.value
switch (choice) {
switch (editorType) {
case 'ace':
setRichText(false)
setNewSourceEditor(false)
@ -60,6 +61,8 @@ function EditorSwitch() {
setRichText(true)
break
}
sendMB('editor-switch-change', { editorType })
},
[setRichText, setNewSourceEditor]
)