mirror of
https://github.com/apache/superset.git
synced 2024-09-18 19:49:37 -04:00
fix: Multiple dashboard refresh triggers for the same session (#16094)
This commit is contained in:
parent
bb1d8fe4ef
commit
07f33998ac
@ -48,7 +48,9 @@ import {
|
|||||||
SAVE_TYPE_OVERWRITE,
|
SAVE_TYPE_OVERWRITE,
|
||||||
DASHBOARD_POSITION_DATA_LIMIT,
|
DASHBOARD_POSITION_DATA_LIMIT,
|
||||||
} from 'src/dashboard/util/constants';
|
} 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';
|
import { options as PeriodicRefreshOptions } from 'src/dashboard/components/RefreshIntervalModal';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
@ -196,6 +198,8 @@ class Header extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
|
stopPeriodicRender(this.refreshTimer);
|
||||||
|
this.props.setRefreshFrequency(0);
|
||||||
clearTimeout(this.ctrlYTimeout);
|
clearTimeout(this.ctrlYTimeout);
|
||||||
clearTimeout(this.ctrlZTimeout);
|
clearTimeout(this.ctrlZTimeout);
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
const stopPeriodicRender = (refreshTimer?: number) => {
|
export const stopPeriodicRender = (refreshTimer?: number) => {
|
||||||
if (refreshTimer) {
|
if (refreshTimer) {
|
||||||
clearInterval(refreshTimer);
|
clearInterval(refreshTimer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user