Skip to content

Commit

Permalink
Disable the button if we can't find any filters
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Jan 23, 2025
1 parent 32bb52c commit c63df77
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,13 @@ export function SummaryTable({
render: function Key(_, item): JSX.Element {
const variantKey = item.key

const filters = getViewRecordingFilters(metric, experiment.feature_flag_key, variantKey)
return (
<LemonButton
size="xsmall"
icon={<IconRewindPlay />}
tooltip="Watch recordings of people who were exposed to this variant."
disabledReason={filters.length === 0 ? 'Unable to identify recordings for this metric' : undefined}
type="secondary"
onClick={() => {
const filterGroup: Partial<RecordingUniversalFilters> = {
Expand All @@ -321,11 +323,7 @@ export function SummaryTable({
values: [
{
type: FilterLogicalOperator.And,
values: getViewRecordingFilters(
metric,
experiment.feature_flag_key,
variantKey
),
values: filters,
},
],
},
Expand Down

0 comments on commit c63df77

Please sign in to comment.