Skip to content

Commit b366548

Browse files
committed
Always turn cancel button off when a query is done
Signed-off-by: Seb Julliand <[email protected]>
1 parent 89482f8 commit b366548

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/views/results/resultSetPanelProvider.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { WebviewView, WebviewViewResolveContext, CancellationToken, commands } from "vscode";
1+
import { CancellationToken, WebviewView, WebviewViewResolveContext, commands } from "vscode";
22

3+
import { setCancelButtonVisibility } from ".";
4+
import { JobManager } from "../../config";
35
import { Query, QueryState } from "../../connection/query";
4-
import * as html from "./html";
56
import { updateStatusBar } from "../jobManager/statusBar";
6-
import { JobManager } from "../../config";
7-
import { setCancelButtonVisibility } from ".";
7+
import * as html from "./html";
88

99
export class ResultSetPanelProvider {
1010
_view: WebviewView;
@@ -38,9 +38,7 @@ export class ResultSetPanelProvider {
3838
queryObject = query;
3939
}
4040

41-
let queryResults = queryObject.getState() == QueryState.RUN_MORE_DATA_AVAILABLE ? await queryObject.fetchMore() : await queryObject.run();
42-
43-
setCancelButtonVisibility(false);
41+
let queryResults = queryObject.getState() == QueryState.RUN_MORE_DATA_AVAILABLE ? await queryObject.fetchMore() : await queryObject.run();
4442

4543
data = queryResults.data;
4644
this._view.webview.postMessage({
@@ -61,6 +59,9 @@ export class ResultSetPanelProvider {
6159
isDone: true
6260
});
6361
}
62+
finally{
63+
setCancelButtonVisibility(false);
64+
}
6465

6566
updateStatusBar();
6667
}

0 commit comments

Comments
 (0)