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

Commit 95ab2d9

Browse files
committed
Use token PropType in RemoteController
1 parent b28a699 commit 95ab2d9

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/controllers/remote-controller.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import React from 'react';
22
import PropTypes from 'prop-types';
33
import {shell} from 'electron';
44

5-
import {autobind} from '../helpers';
65
import {incrementCounter} from '../reporter-proxy';
7-
import {RemotePropType, RemoteSetPropType, BranchSetPropType, EndpointPropType} from '../prop-types';
6+
import {RemotePropType, RemoteSetPropType, BranchSetPropType, EndpointPropType, TokenPropType} from '../prop-types';
87
import IssueishSearchesController from './issueish-searches-controller';
98

109
export default class RemoteController extends React.Component {
@@ -20,7 +19,7 @@ export default class RemoteController extends React.Component {
2019

2120
// Connection
2221
endpoint: EndpointPropType.isRequired,
23-
token: PropTypes.string.isRequired,
22+
token: TokenPropType.isRequired,
2423

2524
// Repository derived attributes
2625
workingDirectory: PropTypes.string,
@@ -35,11 +34,6 @@ export default class RemoteController extends React.Component {
3534
onPushBranch: PropTypes.func.isRequired,
3635
}
3736

38-
constructor(props) {
39-
super(props);
40-
autobind(this, 'onCreatePr');
41-
}
42-
4337
render() {
4438
return (
4539
<IssueishSearchesController
@@ -61,7 +55,7 @@ export default class RemoteController extends React.Component {
6155
);
6256
}
6357

64-
async onCreatePr() {
58+
onCreatePr = async () => {
6559
const currentBranch = this.props.branches.getHeadBranch();
6660
const upstream = currentBranch.getUpstream();
6761
if (!upstream.isPresent() || this.props.aheadCount > 0) {

0 commit comments

Comments
 (0)