Merge pull request from ecency/sa/delegation-update

prefill delegation amount input field with already delegated amount
This commit is contained in:
Feruz M 2022-11-17 19:53:47 +05:30 committed by GitHub
commit f052644d80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions
src
providers/queries
screens/transfer/screen

View File

@ -36,7 +36,6 @@ export const useNotificationsQuery = (filter: NotificationFilters) => {
return lastId;
};
// query initialization
const notificationQueries = useQueries({
queries: pageParams.map((pageParam) => ({
@ -67,7 +66,7 @@ export const useNotificationsQuery = (filter: NotificationFilters) => {
}
};
const _dataArrs = notificationQueries.map(query => query.data);
const _dataArrs = notificationQueries.map((query) => query.data);
return {
data: unionBy(..._dataArrs, 'id'),

View File

@ -164,15 +164,21 @@ class DelegateScreen extends Component {
const vest_shares = parseAsset(curShare.vesting_shares);
this.setState({
delegatedHP: vestsToHp(vest_shares.amount, hivePerMVests).toFixed(3),
hp: vestsToHp(vest_shares.amount, hivePerMVests).toFixed(3),
amount: vest_shares.amount,
});
} else {
this.setState({
delegatedHP: 0,
hp: 0,
amount: 0,
});
}
} else {
this.setState({
delegatedHP: 0,
hp: 0,
amount: 0,
});
}
} catch (err) {
@ -585,9 +591,9 @@ class DelegateScreen extends Component {
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
style={styles.fillSpace}
keyboardShouldPersistTaps
keyboardShouldPersistTaps="always"
>
<ScrollView keyboardShouldPersistTaps contentContainerStyle={styles.grow}>
<ScrollView keyboardShouldPersistTaps="always" contentContainerStyle={styles.grow}>
<View style={styles.container}>
{step >= 1 && _renderStepOne()}
{step >= 2 && _renderStepTwo()}