Skip to content

Commit 08d4f4c

Browse files
committed
Change event nalme
1 parent 714a6dc commit 08d4f4c

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/github/pullRequestOverview.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
4848
/**
4949
* Event emitter for when a PR overview becomes active
5050
*/
51-
private static _onDidChangeActivePullRequest = new vscode.EventEmitter<PullRequestModel>();
52-
public static readonly onDidChangeActivePullRequest = PullRequestOverviewPanel._onDidChangeActivePullRequest.event;
51+
private static _onVisible = new vscode.EventEmitter<PullRequestModel>();
52+
public static readonly onVisible = PullRequestOverviewPanel._onVisible.event;
5353

5454
private _repositoryDefaultBranch: string;
5555
private _existingReviewers: ReviewState[] = [];
@@ -163,10 +163,10 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
163163
protected override onDidChangeViewState(e: vscode.WebviewPanelOnDidChangeViewStateEvent): void {
164164
super.onDidChangeViewState(e);
165165
this.setVisibilityContext();
166-
166+
167167
// If the panel becomes visible and we have an item, notify that this PR is active
168168
if (this._panel.visible && this._item) {
169-
PullRequestOverviewPanel._onDidChangeActivePullRequest.fire(this._item);
169+
PullRequestOverviewPanel._onVisible.fire(this._item);
170170
}
171171
}
172172

@@ -320,10 +320,10 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
320320
}
321321

322322
const result = vscode.window.withProgress({ location: { viewId: 'pr:github' } }, () => this.updateItem(pullRequestModel));
323-
323+
324324
// Notify that this PR overview is now active
325-
PullRequestOverviewPanel._onDidChangeActivePullRequest.fire(pullRequestModel);
326-
325+
PullRequestOverviewPanel._onVisible.fire(pullRequestModel);
326+
327327
return result;
328328
}
329329

@@ -824,7 +824,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
824824
* Static dispose method to clean up static resources
825825
*/
826826
public static dispose() {
827-
PullRequestOverviewPanel._onDidChangeActivePullRequest.dispose();
827+
PullRequestOverviewPanel._onVisible.dispose();
828828
}
829829
}
830830

src/test/github/pullRequestOverview.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ describe('PullRequestOverview', function () {
155155
// Listen for the event
156156
let eventFired = false;
157157
let eventPR: PullRequestModel | undefined;
158-
const disposable = PullRequestOverviewPanel.onDidChangeActivePullRequest(pr => {
158+
const disposable = PullRequestOverviewPanel.onVisible(pr => {
159159
eventFired = true;
160160
eventPR = pr;
161161
});
@@ -193,7 +193,7 @@ describe('PullRequestOverview', function () {
193193
// Listen for the event
194194
let eventCount = 0;
195195
let lastEventPR: PullRequestModel | undefined;
196-
const disposable = PullRequestOverviewPanel.onDidChangeActivePullRequest(pr => {
196+
const disposable = PullRequestOverviewPanel.onVisible(pr => {
197197
eventCount++;
198198
lastEventPR = pr;
199199
});

src/view/prsTreeDataProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
109109
this._register(this._copilotManager.onDidCreatePullRequest(() => this.refresh()));
110110

111111
// Listen for PR overview panel changes to sync the tree view
112-
this._register(PullRequestOverviewPanel.onDidChangeActivePullRequest(pullRequest => {
112+
this._register(PullRequestOverviewPanel.onVisible(pullRequest => {
113113
this.syncWithActivePullRequest(pullRequest);
114114
}));
115115

@@ -187,7 +187,7 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
187187
try {
188188
// First expand the pull request in the tree to make sure it's visible
189189
await this.expandPullRequest(pullRequest);
190-
190+
191191
// Find the PR node in the tree and reveal it
192192
const prNode = await this.findPRNode(pullRequest);
193193
if (prNode) {
@@ -213,7 +213,7 @@ export class PullRequestsTreeDataProvider extends Disposable implements vscode.T
213213
if (found) return found;
214214
} else if (child instanceof CategoryTreeNode) {
215215
const found = await this.findPRNodeInCategory(child, pullRequest);
216-
if (found) return found;
216+
if (found) return found;
217217
}
218218
}
219219
return undefined;

0 commit comments

Comments
 (0)