Commit 129a97c1 authored by mgabdev's avatar mgabdev

Updated Status comments/context to be visible to logged in users

• Updated:
- Status comments/context to be visible to logged in users
parent 670d6b7c
......@@ -5,7 +5,7 @@ class Api::V1::StatusesController < Api::BaseController
before_action -> { authorize_if_got_token! :read, :'read:statuses' }, except: [:create, :update, :destroy]
before_action -> { doorkeeper_authorize! :write, :'write:statuses' }, only: [:create, :update, :destroy]
before_action :require_user!, except: [:show, :comments, :context, :card]
before_action :require_user!, except: [:show]
before_action :set_status, only: [:show, :comments, :context, :card, :update, :revisions]
# This API was originally unlimited, pagination cannot be introduced without
......
......@@ -181,7 +181,7 @@ const deleteStatusFail = (id, error) => ({
*
*/
export const fetchContext = (id, ensureIsReply) => (dispatch, getState) => {
if (!id) return
if (!id || !me) return
if (ensureIsReply) {
const isReply = !!getState().getIn(['statuses', id, 'in_reply_to_id'], null)
......@@ -228,7 +228,7 @@ const fetchContextFail = (id, error) => ({
*
*/
export const fetchComments = (id) => (dispatch, getState) => {
if (!id) return
if (!id || !me) return
debouncedFetchComments(id, dispatch, getState)
}
......
......@@ -517,7 +517,16 @@ class Status extends ImmutablePureComponent {
}
{
status.get('replies_count') > 0 && !isChild && !isNotification && !commentsLimited &&
!me && status.get('replies_count') > 0 && !isChild && !isNotification && !commentsLimited &&
<div className={[_s.d, _s.mr10, _s.ml10, _s.mb10, _s.px15, _s.py15, _s.aiCenter, _s.jcCenter, _s.borderColorSecondary, _s.borderTop1PX].join(' ')}>
<Text color='tertiary' className={[_s.d, _s.py15].join(' ')}>
Sign up to view {status.get('replies_count')} comments.
</Text>
</div>
}
{
!!me && status.get('replies_count') > 0 && !isChild && !isNotification && !commentsLimited &&
<React.Fragment>
<div className={[_s.d, _s.mr10, _s.ml10, _s.mb10, _s.borderColorSecondary, _s.borderBottom1PX].join(' ')} />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment