Skip to content

Commit 6cb7ffc

Browse files
committed
Another go at fixing the damn changelog
html_url is in the top-level 'commit' object, not in commit.commit. Also factor some code out for legibility. Seriously, what's with stuffing everything into inline functions?
1 parent 0ab1dac commit 6cb7ffc

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/components/views/dialogs/ChangelogDialog.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ export default class ChangelogDialog extends React.Component {
4141
}
4242
}
4343

44+
_elementsForCommit(commit) {
45+
return (
46+
<li key={commit.sha} className="mx_ChangelogDialog_li">
47+
<a href={commit.html_url} target="_blank" ref="noopener">
48+
{commit.commit.message}
49+
</a>
50+
</li>
51+
);
52+
}
53+
4454
render() {
4555
const Spinner = sdk.getComponent('views.elements.Spinner');
4656
const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog');
@@ -51,9 +61,7 @@ export default class ChangelogDialog extends React.Component {
5161
<div key={repo}>
5262
<h2>{repo}</h2>
5363
<ul>
54-
{this.state[repo].map(commit =>
55-
<li key={commit.commit.url} className="mx_ChangelogDialog_li"><a href={commit.commit.html_url} target="_blank" ref="noopener">{commit.commit.message}</a></li>
56-
)}
64+
{this.state[repo].map(this._elementsForCommit)}
5765
</ul>
5866
</div>
5967
)

0 commit comments

Comments
 (0)