mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 11:51:52 +03:00
Merge pull request #1118 from esteemapp/bugfix/steemconnect
Bugfix/steemconnect
This commit is contained in:
commit
df271ff1bb
@ -228,12 +228,8 @@ class PointsContainer extends Component {
|
|||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
Alert.alert(
|
this.setState({ isLoading: false });
|
||||||
`Fetching data from server failed, please try again or notify us at info@esteem.app \n${error.message.substr(
|
dispatch(toastNotification(intl.formatMessage({ id: 'alert.fail' })));
|
||||||
0,
|
|
||||||
20,
|
|
||||||
)}`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -117,23 +117,6 @@ class BoostPostScreen extends PureComponent {
|
|||||||
const _permlink = get(seperatedPermlink, '[1]');
|
const _permlink = get(seperatedPermlink, '[1]');
|
||||||
const amount = 150 + 50 * factor;
|
const amount = 150 + 50 * factor;
|
||||||
|
|
||||||
if (get(currentAccount, 'local.authType') === 'steemConnect') {
|
|
||||||
const json = JSON.stringify({
|
|
||||||
user: selectedUser,
|
|
||||||
_author,
|
|
||||||
_permlink,
|
|
||||||
amount,
|
|
||||||
});
|
|
||||||
|
|
||||||
const uri = `sign/custom-json?authority=active&required_auths=%5B%22${selectedUser}%22%5D&required_posting_auths=%5B%5D&id=esteem_boost&json=${encodeURIComponent(
|
|
||||||
json,
|
|
||||||
)}`;
|
|
||||||
|
|
||||||
this.setState({
|
|
||||||
isSCModalOpen: true,
|
|
||||||
SCPath: uri,
|
|
||||||
});
|
|
||||||
} else if (boost) {
|
|
||||||
let userFromRealm;
|
let userFromRealm;
|
||||||
|
|
||||||
if (selectedUser) {
|
if (selectedUser) {
|
||||||
@ -147,7 +130,24 @@ class BoostPostScreen extends PureComponent {
|
|||||||
}
|
}
|
||||||
: currentAccount;
|
: currentAccount;
|
||||||
|
|
||||||
if (amount && _permlink) boost(amount, _permlink, _author, user);
|
if (get(user, 'local.authType') === 'steemConnect') {
|
||||||
|
const json = JSON.stringify({
|
||||||
|
user: get(user, 'name'),
|
||||||
|
author: _author,
|
||||||
|
permlink: _permlink,
|
||||||
|
amount: `${amount.toFixed(3)} POINT`,
|
||||||
|
});
|
||||||
|
|
||||||
|
const uri = `sign/custom-json?authority=active&required_auths=%5B%22${selectedUser}%22%5D&required_posting_auths=%5B%5D&id=esteem_boost&json=${encodeURIComponent(
|
||||||
|
json,
|
||||||
|
)}`;
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
isSCModalOpen: true,
|
||||||
|
SCPath: uri,
|
||||||
|
});
|
||||||
|
} else if (boost) {
|
||||||
|
boost(amount, _permlink, _author, user);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -262,10 +262,10 @@ class BoostPostScreen extends PureComponent {
|
|||||||
|
|
||||||
<MainButton
|
<MainButton
|
||||||
style={styles.quickButtons}
|
style={styles.quickButtons}
|
||||||
isDisable={!(_balance / 50 > factor + 4)}
|
isDisable={!((balance || _balance) / 50 > factor + 4)}
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
this.setState({
|
this.setState({
|
||||||
factor: _balance / 50 > factor + 4 ? factor + 1 : factor,
|
factor: (balance || _balance) / 50 > factor + 4 ? factor + 1 : factor,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@ -283,9 +283,11 @@ class BoostPostScreen extends PureComponent {
|
|||||||
<MainButton
|
<MainButton
|
||||||
style={styles.button}
|
style={styles.button}
|
||||||
isDisable={
|
isDisable={
|
||||||
(!permlink ? !get(navigationParams, 'permlink') : permlink) &&
|
!(
|
||||||
_balance < 150 &&
|
(get(navigationParams, 'permlink') || permlink) &&
|
||||||
(isLoading || !isValid)
|
(balance || _balance) > 150 &&
|
||||||
|
(!isLoading || isValid)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
onPress={() => this.startActionSheet.current.show()}
|
onPress={() => this.startActionSheet.current.show()}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
@ -307,7 +309,7 @@ class BoostPostScreen extends PureComponent {
|
|||||||
cancelButtonIndex={1}
|
cancelButtonIndex={1}
|
||||||
destructiveButtonIndex={0}
|
destructiveButtonIndex={0}
|
||||||
onPress={index => {
|
onPress={index => {
|
||||||
index === 0 &&
|
if (index === 0)
|
||||||
this._boost(boost, currentAccount, getUserDataWithUsername, navigationParams);
|
this._boost(boost, currentAccount, getUserDataWithUsername, navigationParams);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -116,23 +116,6 @@ class PointsScreen extends PureComponent {
|
|||||||
const _author = get(seperatedPermlink, '[0]');
|
const _author = get(seperatedPermlink, '[0]');
|
||||||
const _permlink = get(seperatedPermlink, '[1]');
|
const _permlink = get(seperatedPermlink, '[1]');
|
||||||
|
|
||||||
if (get(currentAccount, 'local.authType') === 'steemConnect') {
|
|
||||||
const json = JSON.stringify({
|
|
||||||
user: selectedUser,
|
|
||||||
_author,
|
|
||||||
_permlink,
|
|
||||||
duration: day,
|
|
||||||
});
|
|
||||||
|
|
||||||
const uri = `sign/custom-json?authority=active&required_auths=%5B%22${selectedUser}%22%5D&required_posting_auths=%5B%5D&id=esteem_promote&json=${encodeURIComponent(
|
|
||||||
json,
|
|
||||||
)}`;
|
|
||||||
|
|
||||||
this.setState({
|
|
||||||
isSCModalOpen: true,
|
|
||||||
SCPath: uri,
|
|
||||||
});
|
|
||||||
} else if (promote) {
|
|
||||||
let userFromRealm;
|
let userFromRealm;
|
||||||
|
|
||||||
if (selectedUser) {
|
if (selectedUser) {
|
||||||
@ -146,6 +129,23 @@ class PointsScreen extends PureComponent {
|
|||||||
}
|
}
|
||||||
: currentAccount;
|
: currentAccount;
|
||||||
|
|
||||||
|
if (get(user, 'local.authType') === 'steemConnect') {
|
||||||
|
const json = JSON.stringify({
|
||||||
|
user: get(user, 'name'),
|
||||||
|
author: _author,
|
||||||
|
permlink: _permlink,
|
||||||
|
duration: day,
|
||||||
|
});
|
||||||
|
|
||||||
|
const uri = `sign/custom-json?authority=active&required_auths=%5B%22${selectedUser}%22%5D&required_posting_auths=%5B%5D&id=esteem_promote&json=${encodeURIComponent(
|
||||||
|
json,
|
||||||
|
)}`;
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
isSCModalOpen: true,
|
||||||
|
SCPath: uri,
|
||||||
|
});
|
||||||
|
} else if (promote) {
|
||||||
promote(day, _permlink, _author, user);
|
promote(day, _permlink, _author, user);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user