Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fire soon function to AzureRDP #4066

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/tree/registries/Azure/AzureRegistryDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class AzureRegistryDataProvider extends RegistryV2DataProvider implements
if (isRegistryRoot(element)) {
if (!await this.subscriptionProvider.isSignedIn()) {
await this.subscriptionProvider.signIn();
this.onDidChangeTreeDataEmitter.fire(element); // TODO: this fires too fast, need a "fire soon" analogue
this.fireSoon(element);
return [];
}

Expand Down Expand Up @@ -215,4 +215,12 @@ export class AzureRegistryDataProvider extends RegistryV2DataProvider implements
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return this.authenticationProviders.get(registryString)!;
}

private fireSoon(element?: CommonRegistryItem | undefined) {
const timeout = setTimeout(() => {
clearTimeout(timeout);
this.onDidChangeTreeDataEmitter.fire(element);
}, 5);
}

}