Skip to content

Commit 62e5143

Browse files
committed
Set fetching once
1 parent 10a2dd6 commit 62e5143

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/workspacesProvider.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,22 @@ export class WorkspaceProvider implements vscode.TreeDataProvider<vscode.TreeIte
4545
// needs to be cleared.
4646
this.cancelPendingRefresh()
4747

48+
let hadError = false
4849
try {
4950
this.workspaces = await this.fetch()
50-
this.fetching = false
51-
this.maybeScheduleRefresh()
5251
} catch (error) {
52+
hadError = true
5353
this.workspaces = []
54-
this.fetching = false
5554
}
5655

56+
this.fetching = false
57+
5758
this.refresh()
59+
60+
// As long as there was no error we can schedule the next refresh.
61+
if (hadError) {
62+
this.maybeScheduleRefresh()
63+
}
5864
}
5965

6066
/**

0 commit comments

Comments
 (0)