Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge 8e1a104 into d403789
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilde Ann Thurium committed Nov 20, 2018
2 parents d403789 + 8e1a104 commit 06627d1
Show file tree
Hide file tree
Showing 3 changed files with 884 additions and 9 deletions.
31 changes: 22 additions & 9 deletions lib/controllers/issueish-detail-controller.js
Expand Up @@ -6,6 +6,8 @@ import {BranchSetPropType, RemoteSetPropType} from '../prop-types';
import {GitError} from '../git-shell-out-strategy';
import EnableableOperation from '../models/enableable-operation';
import IssueishDetailView, {checkoutStates} from '../views/issueish-detail-view';
import PullRequestDetailView from '../views/pr-detail-view';
import IssueDetailView from '../views/issue-detail-view';
import {incrementCounter} from '../reporter-proxy';

export class BareIssueishDetailController extends React.Component {
Expand Down Expand Up @@ -78,15 +80,26 @@ export class BareIssueishDetailController extends React.Component {
}

this.checkoutOp = this.nextCheckoutOp();

return (
<IssueishDetailView
repository={repository}
issueish={repository.issueish}
checkoutOp={this.checkoutOp}
switchToIssueish={this.props.switchToIssueish}
/>
);
const isPr = repository.issueish.__typename === 'PullRequest';
if (isPr) {
return (
<PullRequestDetailView
repository={repository}
issueish={repository.issueish}
checkoutOp={this.checkoutOp}
switchToIssueish={this.props.switchToIssueish}
/>
);
} else {
return (
<IssueDetailView
repository={repository}
issueish={repository.issueish}
checkoutOp={this.checkoutOp}
switchToIssueish={this.props.switchToIssueish}
/>
);
}
}

nextCheckoutOp() {
Expand Down

0 comments on commit 06627d1

Please sign in to comment.