Skip to content

Commit

Permalink
feat(browse): track readviz button clicks
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyhgrant committed May 30, 2024
1 parent 5069ead commit 7f6847c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion browser/src/ReadData/ReadData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { BaseQuery } from '../Query'
import StatusMessage from '../StatusMessage'
import { CheckboxInput } from '../ChartStyles'
import { logButtonClick } from '../analytics'

const IGVBrowser = lazy(() => import('./IGVBrowser'))

Expand Down Expand Up @@ -543,7 +544,14 @@ const ReadDataContainer = ({ datasetId, variantIds }: ReadDataContainerProps) =>
return (
<>
<LoadReadsControls>
<Button id="load-once" disabled={loadOnce} onClick={() => setLoadOnce(!loadOnce)}>
<Button
id="load-once"
disabled={loadOnce}
onClick={() => {
logButtonClick('User loaded readviz data once')
setLoadOnce(!loadOnce)
}}
>
Load once
</Button>
<div>
Expand All @@ -553,6 +561,9 @@ const ReadDataContainer = ({ datasetId, variantIds }: ReadDataContainerProps) =>
id="always-load"
checked={alwaysLoad}
onChange={(e: any) => {
if (e.target.checked) {
logButtonClick('User toggled option to always load readviz data on')
}
setAlwaysLoad(e.target.checked)
setLoadOnce(true)
}}
Expand Down

0 comments on commit 7f6847c

Please sign in to comment.