Skip to content

Commit

Permalink
allow unlimited editing
Browse files Browse the repository at this point in the history
  • Loading branch information
roadscape committed May 29, 2018
1 parent 6080889 commit 5a1000d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
20 changes: 9 additions & 11 deletions src/app/components/cards/Comment.jsx
Expand Up @@ -299,11 +299,11 @@ class CommentImpl extends React.Component {
// hide images if author is in blacklist
const hideImages = ImageUserBlockList.includes(author);

const showDeleteOption = username === author && allowDelete;
const _isPaidout = comment.cashout_time === '1969-12-31T23:59:59'; // TODO: audit after HF19. #1259
const showEditOption = username === author;
const showDeleteOption =
username === author && allowDelete && !_isPaidout;
const showReplyOption = comment.depth < 255;
const archived = comment.cashout_time === '1969-12-31T23:59:59'; // TODO: audit after HF19. #1259
const readonly = archived || $STM_Config.read_only_mode;

let body = null;
let controls = null;
Expand All @@ -325,14 +325,12 @@ class CommentImpl extends React.Component {
{showReplyOption && (
<a onClick={onShowReply}>{tt('g.reply')}</a>
)}{' '}
{!readonly &&
showEditOption && (
<a onClick={onShowEdit}>{tt('g.edit')}</a>
)}{' '}
{!readonly &&
showDeleteOption && (
<a onClick={onDeletePost}>{tt('g.delete')}</a>
)}
{showEditOption && (
<a onClick={onShowEdit}>{tt('g.edit')}</a>
)}{' '}
{showDeleteOption && (
<a onClick={onDeletePost}>{tt('g.delete')}</a>
)}
</span>
</div>
);
Expand Down
16 changes: 7 additions & 9 deletions src/app/components/cards/PostFull.jsx
Expand Up @@ -403,15 +403,15 @@ class PostFull extends React.Component {
);
}

const archived =
const _isPaidout =
post_content.get('cashout_time') === '1969-12-31T23:59:59'; // TODO: audit after HF19. #1259
const readonly = archived || $STM_Config.read_only_mode;
const showReblog = !_isPaidout;
const showPromote =
username && !archived && post_content.get('depth') == 0;
username && !_isPaidout && post_content.get('depth') == 0;
const showReplyOption = post_content.get('depth') < 255;
const showEditOption = username === author;
const showDeleteOption =
username === author && content.stats.allowDelete;
username === author && content.stats.allowDelete && !_isPaidout;

const authorRepLog10 = repLog10(content.author_reputation);
const isPreViewCount =
Expand Down Expand Up @@ -478,20 +478,18 @@ class PostFull extends React.Component {
<Voting post={post} />
</div>
<div className="RightShare__Menu small-11 medium-5 large-5 columns text-right">
{!readonly && (
{showReblog && (
<Reblog author={author} permlink={permlink} />
)}
<span className="PostFull__reply">
{showReplyOption && (
<a onClick={onShowReply}>{tt('g.reply')}</a>
)}{' '}
{!readonly &&
showEditOption &&
{showEditOption &&
!showEdit && (
<a onClick={onShowEdit}>{tt('g.edit')}</a>
)}{' '}
{!readonly &&
showDeleteOption &&
{showDeleteOption &&
!showReply && (
<a onClick={onDeletePost}>
{tt('g.delete')}
Expand Down

0 comments on commit 5a1000d

Please sign in to comment.