Skip to content

Commit 3af3c18

Browse files
authored
Fix can't open PR description from Changes tree (#6779)
1 parent cbe7717 commit 3af3c18

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/commands.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ export function registerCommands(
809809
}),
810810
);
811811

812-
async function openDescriptionCommand(argument: PRNode | IssueModel | undefined) {
812+
async function openDescriptionCommand(argument: RepositoryChangesNode | PRNode | IssueModel | undefined) {
813813
let issueModel: IssueModel | undefined;
814814
if (!argument) {
815815
const activePullRequests: PullRequestModel[] = reposManager.folderManagers
@@ -822,7 +822,13 @@ export function registerCommands(
822822
);
823823
}
824824
} else {
825-
issueModel = argument instanceof PRNode ? argument.pullRequestModel : argument;
825+
if (argument instanceof RepositoryChangesNode) {
826+
issueModel = argument.pullRequestModel;
827+
} else if (argument instanceof PRNode) {
828+
issueModel = argument.pullRequestModel;
829+
} else {
830+
issueModel = argument;
831+
}
826832
}
827833

828834
if (!issueModel) {

0 commit comments

Comments
 (0)