diff --git a/app/components/cards/Comment.jsx b/app/components/cards/Comment.jsx
index 171c140c0..b9f7f146e 100644
--- a/app/components/cards/Comment.jsx
+++ b/app/components/cards/Comment.jsx
@@ -35,8 +35,6 @@ class CommentImpl extends PureComponent {
rootComment: PropTypes.string,
anchorLink: PropTypes.string.isRequired,
deletePost: PropTypes.func.isRequired,
- ignoreList: PropTypes.any,
- negativeCommenters: PropTypes.any
};
static defaultProps = {
@@ -58,7 +56,7 @@ class CommentImpl extends PureComponent {
const content = this.props.cont.get(this.props.content);
if (content) {
- this._checkHide(content, this.props.negativeCommenters);
+ this._checkHide(content)
}
}
@@ -79,7 +77,7 @@ class CommentImpl extends PureComponent {
const content = np.cont.get(np.content);
if (content) {
- this._checkHide(content, np.negativeCommenters);
+ this._checkHide(content)
}
}
@@ -88,16 +86,14 @@ class CommentImpl extends PureComponent {
* - `hideBody` is true when comment rshares OR author rep is negative.
* it hides the comment body (but not the header) until the "reveal comment" link is clicked.
*/
- _checkHide(content, negativeCommenters) {
+ _checkHide(content) {
let hide = hideSubtree(this.props.cont, this.props.content)
- if (content) {
- const comment = content.toJS()
- if (negativeCommenters.has(comment.author)) {
- hide = true
- }
- }
+ // console.log('CON', content.toJS())
+ if (content.get('bad')) {
+ hide = true
+ }
if (hide) {
const { onHide } = this.props;
@@ -134,19 +130,14 @@ class CommentImpl extends PureComponent {
depth,
anchorLink,
showNegativeComments,
- ignoreList,
- negativeCommenters,
sortOrder,
username,
- blocked
} = this.props;
const post = comment.author + '/' + comment.permlink;
const { showReply, showEdit, hide, hideBody } = this.state;
- const ignore = ignoreList && ignoreList.has(comment.author);
-
- if (!showNegativeComments && (hide || ignore)) {
+ if (!showNegativeComments && hide) {
return null;
}
@@ -210,8 +201,6 @@ class CommentImpl extends PureComponent {
rootComment={this._getRootComment(comment)}
showNegativeComments={showNegativeComments}
onHide={this.props.onHide}
- ignoreList={ignoreList}
- negativeCommenters={negativeCommenters}
/>
));
}
@@ -231,10 +220,6 @@ class CommentImpl extends PureComponent {
);
}
- if (negativeCommenters && negativeCommenters.has(username)) {
- renderedEditor =
{tt('delegatevestingshares_jsx.interest')}
@@ -294,7 +324,7 @@ class DelegateVestingShares extends React.Component {
autoCorrect='off'
autoCapitalize='off'
spellCheck='false'
- disabled={loading || vdoExists}
+ disabled={loading || vdoExists || emissionInterest.props.checked}
/>
{interestRate.touched && interestRate.blur && interestRate.error &&
{interestRate.error}
}
@@ -338,7 +368,7 @@ export default connect(
let interestRate = calcDefaultInterest(cprops);
- const initialValues = { to: null, interestRate, }
+ const initialValues = { to: null, interestRate, emissionInterest: false }
return {
...ownProps,
@@ -350,7 +380,7 @@ export default connect(
},
dispatch => ({
- dispatchSubmit: ({ to, amount, interestRate, errorCallback, successCallback, gprops, currentAccount }) => {
+ dispatchSubmit: ({ to, amount, interestRate, emissionInterest, errorCallback, successCallback, gprops, currentAccount }) => {
const delegator = currentAccount.get('name');
const delegatee = to;
const vestingShares = `${steemToVests(amount, gprops)} GESTS`;
@@ -370,6 +400,15 @@ export default connect(
__config = { title: tt('delegate_vesting_shares_info_jsx.confirm_title', { VESTING_TOKENS: tt('token_names.VESTING_TOKENS') }), };
}
+ let extensions =[]
+ if (emissionInterest) {
+ extensions.push([0,
+ {
+ is_emission: true
+ }])
+ interestRate = 100
+ }
+
dispatch(transaction.actions.broadcastOperation({
type: 'delegate_vesting_shares_with_interest',
operation: {
@@ -377,6 +416,7 @@ export default connect(
delegatee,
vesting_shares: vestingShares,
interest_rate: Math.trunc(interestRate * 100),
+ extensions,
__config,
},
confirm,
diff --git a/app/components/modules/DelegateVestingSharesInfo.jsx b/app/components/modules/DelegateVestingSharesInfo.jsx
index fef876903..4c6afd3e7 100644
--- a/app/components/modules/DelegateVestingSharesInfo.jsx
+++ b/app/components/modules/DelegateVestingSharesInfo.jsx
@@ -63,7 +63,7 @@ class DelegateVestingSharesInfo extends React.Component {
{vestingShares_str}
- {interestRate}%
+ {c.is_emission ? tt('delegatevestingshares_jsx.no_interest_emission') : interestRate + '%'}
|
{type === 'delegated' && isMyAccount && (
diff --git a/app/components/modules/Donate.jsx b/app/components/modules/Donate.jsx
index 345b0ffdb..7187464ac 100644
--- a/app/components/modules/Donate.jsx
+++ b/app/components/modules/Donate.jsx
@@ -17,6 +17,7 @@ import TipAssetList from 'app/components/elements/donate/TipAssetList'
import VoteSlider from 'app/components/elements/donate/VoteSlider'
import { checkMemo } from 'app/utils/ParsersAndFormatters';
import { accuEmissionPerDay } from 'app/utils/StateFunctions'
+import { checkAllowed, AllowTypes } from 'app/utils/Allowance'
class Donate extends React.Component {
constructor(props) {
@@ -86,18 +87,24 @@ class Donate extends React.Component {
this.props.setDonateDefaults(donateDefs)
}
- _onSubmit = (values, actions) => {
+ _onSubmit = async (values, actions) => {
const { currentUser, opts, dispatchSubmit } = this.props
const { to, permlink, is_comment } = opts
const { isMemoEncrypted } = this.state
const vote = {
percent: values.sliderPercent * 100
}
- dispatchSubmit({
+ await dispatchSubmit({
to, amount: values.amount.asset, memo: values.memo, isMemoEncrypted,
- permlink, is_comment, vote, myVote: opts.myVote * 100, currentUser,
+ permlink, is_comment,
+ vote,
+ myVote: opts.myVote * 100,
+ voteAllowType: opts.voteAllowType,
+ currentUser,
errorCallback: (err) => {
- actions.setErrors({ memo: err.message || err })
+ if (err) {
+ actions.setErrors({ memo: err.message || err })
+ }
actions.setSubmitting(false)
}
})
@@ -254,9 +261,9 @@ export default connect(
setDonateDefaults: (donateDefaults) => {
dispatch(user.actions.setDonateDefaults(donateDefaults))
},
- dispatchSubmit: ({
+ dispatchSubmit: async ({
to, amount, memo, isMemoEncrypted,
- permlink, is_comment, vote, myVote, currentUser, errorCallback
+ permlink, is_comment, vote, myVote, voteAllowType, currentUser, errorCallback
}) => {
const username = currentUser.get('username')
@@ -277,13 +284,20 @@ export default connect(
let trx = [
['donate', operation]
]
+ let aTypes = [
+ AllowTypes.transfer
+ ]
if (vote && vote.percent !== myVote) {
const voteOp = {
voter: username, author: to, permlink,
weight: vote.percent
}
- if (amount.amount <= 0) trx = []
+ if (amount.amount <= 0) {
+ trx = []
+ aTypes = []
+ }
trx.push(['vote', voteOp])
+ aTypes.push(voteAllowType)
if (!myVote) {
localStorage.removeItem('vote_weight'); // deprecated
@@ -303,8 +317,17 @@ export default connect(
dispatch(user.actions.hideDonate())
}
+ let confirm
+ const tipAmount = Asset(operation.amount)
+ const blocking = await checkAllowed(operation.from, [operation.to], tipAmount, aTypes)
+ if (blocking.error) {
+ errorCallback(blocking.error)
+ return
+ }
+ confirm = blocking.confirm
+
dispatch(transaction.actions.broadcastOperation({
- type: 'donate', username, trx, successCallback, errorCallback
+ type: 'donate', username, trx, confirm, successCallback, errorCallback
}))
}
})
diff --git a/app/components/modules/Header.jsx b/app/components/modules/Header.jsx
index 281a5a3ca..df752da03 100644
--- a/app/components/modules/Header.jsx
+++ b/app/components/modules/Header.jsx
@@ -198,7 +198,7 @@ class Header extends React.Component {
- {APP_NAME_UP}blockchain
+ {APP_NAME_UP}blogs platform
{selected_sort_order && }
diff --git a/app/components/modules/LoginForm.jsx b/app/components/modules/LoginForm.jsx
index 5dba254be..ca2962912 100644
--- a/app/components/modules/LoginForm.jsx
+++ b/app/components/modules/LoginForm.jsx
@@ -13,7 +13,7 @@ import reactForm from 'app/utils/ReactForm'
import tt from 'counterpart';
import { APP_DOMAIN } from 'app/client_config';
import { translateError } from 'app/utils/ParsersAndFormatters';
-import { authRegisterUrl, } from 'app/utils/AuthApiClient';
+import { authUrl, authRegisterUrl, } from 'app/utils/AuthApiClient';
class LoginForm extends Component {
@@ -158,7 +158,15 @@ class LoginForm extends Component {
const submitLabel = loginBroadcastOperation ? tt('g.sign_in') : tt('g.login');
const cancelIsRegister = loginDefault && loginDefault.get('cancelIsRegister');
let error = password.touched && password.error ? password.error : this.props.login_error;
- if (error === 'owner_login_blocked') {
+ if (error === 'account_frozen') {
+ error =
+ {tt('loginform_jsx.account_frozen')}
+
+
+ {tt('g.more_hint')}
+
+
+ } else if (error === 'owner_login_blocked') {
error =
{tt('loginform_jsx.this_password_is_bound_to_your_account_owner_key')}
diff --git a/app/components/modules/PostForm/PostForm.jsx b/app/components/modules/PostForm/PostForm.jsx
index 1d734d295..7f7821c82 100644
--- a/app/components/modules/PostForm/PostForm.jsx
+++ b/app/components/modules/PostForm/PostForm.jsx
@@ -28,6 +28,7 @@ import {
updateFavoriteTags,
} from 'app/utils/tags';
import { DRAFT_KEY, EDIT_KEY } from 'app/utils/postForm';
+import { checkAllowed, AllowTypes } from 'app/utils/Allowance'
const EDITORS_TYPES = {
MARKDOWN: 1,
@@ -665,6 +666,7 @@ class PostForm extends React.Component {
this.props.onPost(
data,
+ editMode,
() => {
try {
if (editMode) {
@@ -692,7 +694,7 @@ class PostForm extends React.Component {
isPosting: false,
});
- this.refs.footer.showPostError(err.toString().trim());
+ if (err) this.refs.footer.showPostError(err.toString().trim());
}
}
);
@@ -801,11 +803,20 @@ export default connect(
categories: state.global.get('tag_idx'),
}),
dispatch => ({
- onPost(payload, onSuccess, onError) {
+ async onPost(payload, editMode, onSuccess, onError) {
+ let blocking = await checkAllowed(payload.author,
+ [],
+ null, editMode ? AllowTypes.postEdit : AllowTypes.post)
+ if (blocking.error) {
+ onError(blocking.error)
+ return
+ }
+ const confirm = blocking.confirm
dispatch(
transaction.actions.broadcastOperation({
type: 'comment',
operation: payload,
+ confirm,
hideErrors: true,
errorCallback: onError,
successCallback: onSuccess,
diff --git a/app/components/modules/Settings.jsx b/app/components/modules/Settings.jsx
index 4f93e838d..951637be3 100644
--- a/app/components/modules/Settings.jsx
+++ b/app/components/modules/Settings.jsx
@@ -6,6 +6,7 @@ import tt from 'counterpart';
import throttle from 'lodash/throttle'
import transaction from 'app/redux/Transaction'
import { getMetadataReliably } from 'app/utils/NormalizeProfile';
+import DoNotBother from 'app/components/elements/DoNotBother';
import Icon from 'app/components/elements/Icon';
import LoadingIndicator from 'app/components/elements/LoadingIndicator'
import Userpic from 'app/components/elements/Userpic';
@@ -303,9 +304,9 @@ class Settings extends React.Component {
const {profile_image, cover_image, name, about, gender, location, website, donatePresets, emissionDonatePct, notifyPresets, notifyPresetsTouched} = this.state
- const {follow, account, isOwnAccount} = this.props
+ const {follow, block, account, isOwnAccount} = this.props
const following = follow && follow.getIn(['getFollowingAsync', account.name]);
- const ignores = isOwnAccount && following && following.get('ignore_result');
+ const ignores = isOwnAccount && block && block.getIn(['blocking', account.name, 'result'])
const mutedInNew = isOwnAccount && props.mutedInNew;
let mutedUIA = [];
if (process.env.BROWSER) {
@@ -542,6 +543,8 @@ class Settings extends React.Component {
}
+
+
{ignores && ignores.size > 0 &&
@@ -580,6 +583,7 @@ export default connect(
isOwnAccount: username == accountname,
profile,
mutedInNew,
+ block: state.global.get('block'),
follow: state.global.get('follow'),
...ownProps
}
diff --git a/app/components/modules/Transfer.jsx b/app/components/modules/Transfer.jsx
index 98ed972f6..e8bee8b79 100644
--- a/app/components/modules/Transfer.jsx
+++ b/app/components/modules/Transfer.jsx
@@ -1,8 +1,11 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types'
import ReactDOM from 'react-dom';
-import reactForm from 'app/utils/ReactForm';
import {Map} from 'immutable';
+import tt from 'counterpart';
+import { Asset } from 'golos-lib-js/lib/utils'
+
+import reactForm from 'app/utils/ReactForm';
import transaction from 'app/redux/Transaction';
import user from 'app/redux/User';
import g from 'app/redux/GlobalReducer';
@@ -11,9 +14,9 @@ import runTests, {browserTests} from 'app/utils/BrowserTests';
import {validate_account_name} from 'app/utils/ChainValidation';
import { saveMemo, loadMemo, clearOldMemos, } from 'app/utils/UIA';
import {countDecimals, formatAmount, checkMemo} from 'app/utils/ParsersAndFormatters';
-import tt from 'counterpart';
import { LIQUID_TICKER, DEBT_TICKER , VESTING_TOKEN2 } from 'app/client_config';
import VerifiedExchangeList from 'app/utils/VerifiedExchangeList';
+import { checkAllowed } from 'app/utils/Allowance'
import DropdownMenu from 'app/components/elements/DropdownMenu';
import Icon from 'app/components/elements/Icon';
@@ -103,13 +106,12 @@ class TransferForm extends Component {
const {toVesting, uia} = props
const isWithdraw = transferType && transferType === 'Savings Withdraw'
const isTIP = transferType && transferType.startsWith('TIP to')
- const isClaim = transferType && transferType === 'Claim'
const isIssueUIA = (transferType === 'Issue UIA')
const insufficientFunds = (asset, amount) => {
const {currentAccount, uia} = this.props
const balanceValue =
!asset || asset === 'GOLOS' ?
- isWithdraw ? currentAccount.get('savings_balance') : (isTIP ? currentAccount.get('tip_balance') : (isClaim ? currentAccount.get('accumulative_balance') : currentAccount.get('balance'))) :
+ isWithdraw ? currentAccount.get('savings_balance') : (isTIP ? currentAccount.get('tip_balance') : currentAccount.get('balance')) :
asset === 'GBG' ?
isWithdraw ? currentAccount.get('savings_sbd_balance') : currentAccount.get('sbd_balance') :
isIssueUIA ? uia.get('can_issue') :
@@ -121,7 +123,7 @@ class TransferForm extends Component {
return parseFloat(amount) > parseFloat(balance)
}
const fields = toVesting ? ['to', 'amount'] : ['to', 'amount', 'asset']
- if(!toVesting && transferType !== 'Transfer to Savings' && transferType !== 'Savings Withdraw' && transferType !== 'Claim')
+ if(!toVesting && transferType !== 'Transfer to Savings' && transferType !== 'Savings Withdraw')
fields.push('memo')
reactForm({
@@ -131,7 +133,7 @@ class TransferForm extends Component {
validation: values => { return {
to:
! values.to ? tt('g.required') :
- (VerifiedExchangeList.includes(values.to) && (isTIP || isClaim)) ? tt('transfer_jsx.verified_exchange_liquid_only') :
+ (VerifiedExchangeList.includes(values.to) && isTIP) ? tt('transfer_jsx.verified_exchange_liquid_only') :
(VerifiedExchangeList.includes(values.to) && values.memo === '') ? tt('transfer_jsx.verified_exchange_no_memo') :
validate_account_name(values.to),
amount:
@@ -157,9 +159,8 @@ class TransferForm extends Component {
const {transferType} = this.props.initialValues
const {currentAccount} = this.props
const isWithdraw = transferType && transferType === 'Savings Withdraw'
- const isClaim = transferType && transferType === 'Claim'
const isTIP = transferType && transferType.startsWith('TIP to')
- return isWithdraw ? currentAccount.get('savings_balance') : (isTIP ? currentAccount.get('tip_balance') : (isClaim ? currentAccount.get('accumulative_balance') : currentAccount.get('balance')))
+ return isWithdraw ? currentAccount.get('savings_balance') : (isTIP ? currentAccount.get('tip_balance') : currentAccount.get('balance'))
}
balanceValue() {
@@ -168,11 +169,10 @@ class TransferForm extends Component {
const {asset} = this.state
const isWithdraw = transferType && transferType === 'Savings Withdraw'
const isTIP = transferType && transferType.startsWith('TIP to')
- const isClaim = transferType && transferType === 'Claim'
const isIssueUIA = (transferType === 'Issue UIA')
return !asset ||
asset.value === 'GOLOS' ?
- isWithdraw ? currentAccount.get('savings_balance') : (isTIP ? currentAccount.get('tip_balance') : (isClaim ? currentAccount.get('accumulative_balance') : currentAccount.get('balance'))) :
+ isWithdraw ? currentAccount.get('savings_balance') : (isTIP ? currentAccount.get('tip_balance') : currentAccount.get('balance')) :
asset.value === 'GBG' ?
isWithdraw ? currentAccount.get('savings_sbd_balance') : currentAccount.get('sbd_balance') :
isIssueUIA ?
@@ -408,8 +408,8 @@ class TransferForm extends Component {
const amountLabel = tt('g.amount')
const columns = this._getColumnSizes()
const form = (
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/components/pages/Post.jsx b/app/components/pages/Post.jsx
index 0e6b5c72f..eb6eea663 100644
--- a/app/components/pages/Post.jsx
+++ b/app/components/pages/Post.jsx
@@ -23,7 +23,6 @@ class Post extends React.Component {
routeParams: PropTypes.object,
location: PropTypes.object,
current_user: PropTypes.object,
- negativeCommenters: PropTypes.any,
};
constructor() {
@@ -99,14 +98,14 @@ class Post extends React.Component {
} else {
children =
{tt('poststub.onlyblog')}
-
+
}
return this._renderStub(children)
}
render() {
- const {following, ignoring, content, negativeCommenters, current_user} = this.props
+ const {following, content, current_user} = this.props
const {showNegativeComments, commentHidden, showAnyway} = this.state
let { post } = this.props;
const { aiPosts } = this.props;
@@ -149,12 +148,7 @@ class Post extends React.Component {
const keep = a => {
const c = content.get(a);
const hide = c.getIn(['stats', 'hide'])
- let ignore = false
- if(ignoring) {
- ignore = ignoring.has(c.get('author'))
- // if(ignore) console.log(current_user && current_user.get('username'), 'is ignoring post author', c.get('author'), '\t', a)
- }
- return !hide && !ignore
+ return !hide
}
const positiveComments = replies.filter(a => keep(a))
.map(reply => (
@@ -166,14 +160,12 @@ class Post extends React.Component {
sortOrder={sort_order}
showNegativeComments={showNegativeComments}
onHide={this.onHideComment}
- ignoreList={ignoring}
- negativeCommenters={negativeCommenters}
/>)
);
const negativeGroup = commentHidden &&
(
-
+
{tt(showNegativeComments ? 'post_jsx.now_showing_comments_with_low_ratings' : 'post_jsx.comments_were_hidden_due_to_low_ratings')}.{' '}
{(current_user || showNegativeComments) ? |