Skip to content

Commit b6694ef

Browse files
Copilotalexr00
andcommitted
Move dev mode check to doInitialize instead of setIssueData
Check dev mode once at initialization time rather than in each setIssueData call. This is more efficient and cleaner. Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent dd65128 commit b6694ef

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/issues/stateManager.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,11 @@ export class StateManager {
230230
}),
231231
);
232232
this.registerRepositoryChangeEvent();
233-
await this.setAllIssueData();
233+
// Skip fetching issues if dev mode is enabled
234+
const devMode = vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE).get<boolean>(DEV_MODE, false);
235+
if (!devMode) {
236+
await this.setAllIssueData();
237+
}
234238
this.context.subscriptions.push(
235239
this.onRefreshCacheNeeded(async () => {
236240
await this.refresh();
@@ -312,12 +316,6 @@ export class StateManager {
312316
}
313317

314318
private async setIssueData(folderManager: FolderRepositoryManager) {
315-
// Skip fetching issues if dev mode is enabled
316-
const devMode = vscode.workspace.getConfiguration(PR_SETTINGS_NAMESPACE).get<boolean>(DEV_MODE, false);
317-
if (devMode) {
318-
return;
319-
}
320-
321319
const singleRepoState = this.getOrCreateSingleRepoState(folderManager.repository.rootUri, folderManager);
322320
if (!singleRepoState) {
323321
return;

0 commit comments

Comments
 (0)