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?
This commit is contained in:
Richard van der Hoff 2016-09-18 23:56:55 +01:00
parent 0ab1dacb1e
commit 6cb7ffcd3b
1 changed files with 11 additions and 3 deletions

View File

@ -41,6 +41,16 @@ export default class ChangelogDialog extends React.Component {
}
}
_elementsForCommit(commit) {
return (
<li key={commit.sha} className="mx_ChangelogDialog_li">
<a href={commit.html_url} target="_blank" ref="noopener">
{commit.commit.message}
</a>
</li>
);
}
render() {
const Spinner = sdk.getComponent('views.elements.Spinner');
const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog');
@ -51,9 +61,7 @@ export default class ChangelogDialog extends React.Component {
<div key={repo}>
<h2>{repo}</h2>
<ul>
{this.state[repo].map(commit =>
<li key={commit.commit.url} className="mx_ChangelogDialog_li"><a href={commit.commit.html_url} target="_blank" ref="noopener">{commit.commit.message}</a></li>
)}
{this.state[repo].map(this._elementsForCommit)}
</ul>
</div>
)