mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 17:23:48 -05:00
Merge pull request #10797 from overleaf/td-editor-toggle-analytics
Add analytics for switching editor GitOrigin-RevId: 7b44e53105e8669e97cb9c4821dfbc830faff779
This commit is contained in:
parent
04d0eabb32
commit
fa67c3fcff
1 changed files with 5 additions and 2 deletions
|
@ -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]
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue