Skip to content

Commit 231e4aa

Browse files
authored
Merge pull request #4 from gitopia/fix-console-errors
Fix console errors
2 parents 97c9520 + 984a3d6 commit 231e4aa

3 files changed

Lines changed: 25 additions & 22 deletions

File tree

src/ui/components/argit/Layout/BranchDropdown.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,17 @@ const BranchDropdown = props => {
2626
{getBranchFromRef(props.currentRef)}
2727
</DropdownToggle>
2828
<DropdownMenu>
29-
{props.refs.map(ref => {
30-
return (
31-
<DropdownItem
32-
disabled={ref === props.currentRef}
33-
onClick={() => {
34-
props.updateCurrentRef({ currentRef: ref })
35-
}}
36-
>
37-
{getBranchFromRef(ref)}
38-
</DropdownItem>
39-
)
40-
})}
29+
{props.refs.map(ref => (
30+
<DropdownItem
31+
key={ref}
32+
disabled={ref === props.currentRef}
33+
onClick={() => {
34+
props.updateCurrentRef({ currentRef: ref })
35+
}}
36+
>
37+
{getBranchFromRef(ref)}
38+
</DropdownItem>
39+
))}
4140
</DropdownMenu>
4241
</Dropdown>
4342
)

src/ui/components/organisms/RepositoryBrowser/DirectoryLine.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,23 +216,27 @@ interface LinkedLinesState {
216216
}
217217

218218
class LinkedLines extends React.Component<LinkedLinesProps, LinkedLinesState> {
219+
_isMounted = false
219220
state = { fileList: [] }
220221

221222
async componentDidMount() {
222-
const {repositoryURL, repositoryHead, root, dirpath} = this.props
223+
this._isMounted = true
224+
const { repositoryURL, repositoryHead, root, dirpath } = this.props
225+
223226
if (repositoryHead) {
224-
await loadDirectory(
225-
arweave,
226-
repositoryURL,
227-
repositoryHead,
228-
root,
229-
dirpath
230-
)
227+
await loadDirectory(arweave, repositoryURL, repositoryHead, root, dirpath)
231228
const fileList = await readFileStats(root, dirpath)
232-
this.setState({ fileList })
229+
230+
if (this._isMounted) {
231+
this.setState({ fileList })
232+
}
233233
}
234234
}
235235

236+
componentWillUnmount() {
237+
this._isMounted = false
238+
}
239+
236240
render() {
237241
const { dirpath, depth, root, editingFilepath } = this.props
238242

src/ui/components/utils/StackRouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ export const StackRouter = connector(
360360
{/* <DgitScore /> */}
361361
<Container>
362362
{repositoryHead && (
363-
<Row alignItems="center" flexCol>
363+
<Row alignitems="center" flexcol="true">
364364
<Col xs="12">
365365
<div className="card-dgit">
366366
<CardBody>

0 commit comments

Comments
 (0)