Merge pull request #2239 from paulkaplan/fix-comments-id

Use #comments-id instead of #comment-id for fetching single comments
This commit is contained in:
Paul Kaplan 2018-10-25 16:56:27 -04:00 committed by GitHub
commit f2490baa16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -128,7 +128,7 @@ class Comment extends React.Component {
className={classNames('flex-row', 'comment', {
'highlighted-comment': highlighted
})}
id={`comment-${id}`}
id={`comments-${id}`}
ref={this.setRef}
>
<a href={`/users/${author.username}`}>

View file

@ -66,8 +66,8 @@ class Preview extends React.Component {
// parts[1]: either :id or 'editor'
// parts[2]: undefined if no :id, otherwise either 'editor' or 'fullscreen'
// Get single-comment id from url hash, using the #comment-{id} scheme from scratch2
const commentHashPrefix = '#comment-';
// Get single-comment id from url hash, using the #comments-{id} scheme from scratch2
const commentHashPrefix = '#comments-';
const singleCommentId = window.location.hash.indexOf(commentHashPrefix) !== -1 &&
parseInt(window.location.hash.replace(commentHashPrefix, ''), 10);