mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
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:
commit
f2490baa16
2 changed files with 3 additions and 3 deletions
|
@ -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}`}>
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue