diff --git a/web/app/common/store.js b/web/app/common/store.js index 0f033f24..9e5fda31 100644 --- a/web/app/common/store.js +++ b/web/app/common/store.js @@ -110,7 +110,9 @@ class Store { } getPinnedComments() { - return this.data.comments.reduce((acc, thread) => acc.concat(findPinnedComments(thread)), []); + const comments = this.data.comments || []; + + return comments.reduce((acc, thread) => acc.concat(findPinnedComments(thread)), []); } } diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index 17dcde07..ff092674 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -185,6 +185,7 @@ export default class Comment extends Component { const { data, mix, mods = {} } = props; const isAdmin = !guest && store.get('user').admin; const isGuest = guest || !Object.keys(store.get('user')).length; + const isCurrentUser = (data.user && data.user.id) === (store.get('user') && store.get('user').id); const o = { ...data, @@ -274,9 +275,9 @@ export default class Comment extends Component { Vote up @@ -285,9 +286,9 @@ export default class Comment extends Component { Vote down