Skip to content

Commit 395d343

Browse files
committed
Move repository variable assignment to constructor
1 parent fa7a094 commit 395d343

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/components/GitPanel.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class GitPanel extends React.Component<IGitPanelProps, IGitPanelState> {
122122
nCommitsAhead: 0,
123123
nCommitsBehind: 0,
124124
pastCommits: [],
125-
repository: null,
125+
repository: props.model.pathRepository,
126126
tab: 0
127127
};
128128
}
@@ -133,10 +133,6 @@ export class GitPanel extends React.Component<IGitPanelProps, IGitPanelState> {
133133
componentDidMount(): void {
134134
const { model, settings } = this.props;
135135

136-
this.setState({
137-
repository: model.pathRepository
138-
});
139-
140136
model.repositoryChanged.connect((_, args) => {
141137
this.setState({
142138
repository: args.newValue

0 commit comments

Comments
 (0)