Skip to content

Commit

Permalink
fix: Multiple dashboard refresh triggers for the same session (#16094)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Aug 10, 2021
1 parent bb1d8fe commit 07f3399
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion superset-frontend/src/dashboard/components/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ import {
SAVE_TYPE_OVERWRITE,
DASHBOARD_POSITION_DATA_LIMIT,
} from 'src/dashboard/util/constants';
import setPeriodicRunner from 'src/dashboard/util/setPeriodicRunner';
import setPeriodicRunner, {
stopPeriodicRender,
} from 'src/dashboard/util/setPeriodicRunner';
import { options as PeriodicRefreshOptions } from 'src/dashboard/components/RefreshIntervalModal';

const propTypes = {
Expand Down Expand Up @@ -196,6 +198,8 @@ class Header extends React.PureComponent {
}

componentWillUnmount() {
stopPeriodicRender(this.refreshTimer);
this.props.setRefreshFrequency(0);
clearTimeout(this.ctrlYTimeout);
clearTimeout(this.ctrlZTimeout);
}
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/dashboard/util/setPeriodicRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
const stopPeriodicRender = (refreshTimer?: number) => {
export const stopPeriodicRender = (refreshTimer?: number) => {
if (refreshTimer) {
clearInterval(refreshTimer);
}
Expand Down

0 comments on commit 07f3399

Please sign in to comment.