Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jczhong84 committed Nov 22, 2024
1 parent 8b086fa commit fca4ccc
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions querybook/webapp/components/QueryRunButton/QueryRunButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,18 +303,11 @@ const TableSamplingSelector: React.FC<{
);

React.useEffect(() => {
if (
sampleRate === undefined ||
!sampleRateOptions.some((option) => option.value === sampleRate)
) {
// If it is a new cell without the sample rate selected, use the default sample rate from user settings
if (sampleRate === undefined) {
setSampleRate(parseFloat(userDefaultTableSampleRate));
}
}, [
sampleRate,
setSampleRate,
sampleRateOptions,
userDefaultTableSampleRate,
]);
}, [sampleRate, setSampleRate, userDefaultTableSampleRate]);

const selectedSampleRateText = React.useMemo(() => {
if (sampleRate > 0) {
Expand Down

0 comments on commit fca4ccc

Please sign in to comment.