mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix for Markdown File in Jupyter Books Viewlet not Opening After 2x (#8009)
* fix for markdown not opening after opened twice * PR comment to add return type
This commit is contained in:
@@ -203,8 +203,7 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
private runThrottledAction(resource: string, action: () => void) {
|
private runThrottledAction(resource: string, action: () => void) {
|
||||||
const isResourceChange = resource !== this._resource;
|
const isResourceChange = resource !== this._resource;
|
||||||
if (isResourceChange) {
|
if (isResourceChange) {
|
||||||
clearTimeout(this._throttleTimer);
|
this.clearAndResetThrottleTimer();
|
||||||
this._throttleTimer = undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this._resource = resource;
|
this._resource = resource;
|
||||||
@@ -214,11 +213,19 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
|||||||
if (isResourceChange) {
|
if (isResourceChange) {
|
||||||
action();
|
action();
|
||||||
} else {
|
} else {
|
||||||
this._throttleTimer = setTimeout(() => action(), 300);
|
this._throttleTimer = setTimeout(() => {
|
||||||
|
action();
|
||||||
|
this.clearAndResetThrottleTimer();
|
||||||
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private clearAndResetThrottleTimer(): void {
|
||||||
|
clearTimeout(this._throttleTimer);
|
||||||
|
this._throttleTimer = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
openExternalLink(resource: string): void {
|
openExternalLink(resource: string): void {
|
||||||
try {
|
try {
|
||||||
vscode.env.openExternal(vscode.Uri.parse(resource));
|
vscode.env.openExternal(vscode.Uri.parse(resource));
|
||||||
|
|||||||
Reference in New Issue
Block a user