mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -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) {
|
||||
const isResourceChange = resource !== this._resource;
|
||||
if (isResourceChange) {
|
||||
clearTimeout(this._throttleTimer);
|
||||
this._throttleTimer = undefined;
|
||||
this.clearAndResetThrottleTimer();
|
||||
}
|
||||
|
||||
this._resource = resource;
|
||||
@@ -214,11 +213,19 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
if (isResourceChange) {
|
||||
action();
|
||||
} 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 {
|
||||
try {
|
||||
vscode.env.openExternal(vscode.Uri.parse(resource));
|
||||
|
||||
Reference in New Issue
Block a user