From 54da5e42cb0bef9c2d9bc15a5ba1a0c6870ec4c3 Mon Sep 17 00:00:00 2001 From: Peter Kosztolanyi Date: Fri, 9 Jul 2021 02:22:12 +0100 Subject: [PATCH] Stop only running queries --- superset-frontend/src/SqlLab/components/SqlEditor.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/SqlLab/components/SqlEditor.jsx b/superset-frontend/src/SqlLab/components/SqlEditor.jsx index 19daf541a2fd9..f869e6bb1f5f7 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor.jsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor.jsx @@ -246,8 +246,10 @@ class SqlEditor extends React.PureComponent { } onBeforeUnload(event) { - event.preventDefault(); - this.stopQuery(); + if (this.props.latestQuery?.state === 'running') { + event.preventDefault(); + this.stopQuery(); + } } onSqlChanged(sql) {