Skip to content

Commit

Permalink
Fix decrypt fee
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Dec 13, 2023
1 parent dbfb7e2 commit aa7bc54
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/components/elements/EncryptedStub.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ class EncryptedStub extends React.Component {
})
}

if (this.state.submitting) {
return <LoadingIndicator type='circle' />
}

const { err } = this.state

return <div>
Expand Down Expand Up @@ -111,7 +107,7 @@ class EncryptedStub extends React.Component {
_renderDonate = (decrypt_fee, isMy) => {
if (isMy || !decrypt_fee) return null
decrypt_fee = Asset(decrypt_fee)
if (decrypt_fee.eq(0)) return
if (decrypt_fee.eq(0)) return null
return <div>
{tt('poststub.you_can_decrypt_just_this_post')}
<b>{decrypt_fee.floatString}</b>.<br/>
Expand Down Expand Up @@ -142,6 +138,10 @@ class EncryptedStub extends React.Component {

const btn = isMy && <div><button onClick={this.onDeleteClick} className='button alert slim hollow'>{tt('g.remove')}</button></div>

if (this.state.submitting) {
return <LoadingIndicator type='circle' />
}

if ((encrypted === EncryptedStates.no_sponsor && !username) || encrypted === EncryptedStates.no_auth) {
return (<div>
{this._renderAuthor(tt('poststub.for_sponsors'), author)}
Expand Down Expand Up @@ -172,8 +172,10 @@ class EncryptedStub extends React.Component {
} else if (encrypted === EncryptedStates.no_sub) {
const encrypted_decrypt_fee = dis.get('encrypted_decrypt_fee')

return <div>{tt('postsummary_jsx.no_sub')}
{this._renderDonate(encrypted_decrypt_fee, isMy)}
const donateWay = this._renderDonate(encrypted_decrypt_fee, isMy)

return <div>{!donateWay && tt('postsummary_jsx.no_sub')}
{donateWay}
</div>
} else if (encrypted === EncryptedStates.wrong_format) {
return <div>{tt('postsummary_jsx.wrong_format')}{btn}</div>
Expand Down

0 comments on commit aa7bc54

Please sign in to comment.