From 067d24ab372e4da2a14f57e08ecba2aa760233d3 Mon Sep 17 00:00:00 2001 From: Ana G <40721795+Bitcoinera@users.noreply.github.com> Date: Tue, 3 Dec 2019 22:35:45 +0100 Subject: [PATCH] Ana/fix rewards updating (#3235) * fix lint error * fix more lint errors * add userrewardsincremented. err cannot query field * changelog * fix user rewards increment add validator fragment * get rid of user rewards increment subscription * rewards updating in tmbalance * update rewards also for validators * delete unnecessary code * delete usertransaction added completely * pass logic from livalidator to tablevalidators * fix lint --- changes/ana_fix-rewards-updating | 1 + src/components/common/TmBalance.vue | 20 ++++++++++++++++ src/components/staking/LiValidator.vue | 11 --------- src/components/staking/PageValidator.vue | 28 ++++++++++++---------- src/components/staking/TableValidators.vue | 23 ++++++++++++++++++ 5 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 changes/ana_fix-rewards-updating diff --git a/changes/ana_fix-rewards-updating b/changes/ana_fix-rewards-updating new file mode 100644 index 0000000000..414f8e00b6 --- /dev/null +++ b/changes/ana_fix-rewards-updating @@ -0,0 +1 @@ +[Added] [#3095](https://github.com/cosmos/lunie/issues/3095) Add the subscription to automatically update the user rewards @Bitcoinera \ No newline at end of file diff --git a/src/components/common/TmBalance.vue b/src/components/common/TmBalance.vue index 297d254612..6c79cafa05 100644 --- a/src/components/common/TmBalance.vue +++ b/src/components/common/TmBalance.vue @@ -147,6 +147,26 @@ export default { // query if successful or not as even an unsuccessful tx costs fees refetchNetworkOnly(this.$apollo.queries.overview) } + }, + blockAdded: { + variables() { + return { + networkId: this.network + } + }, + query() { + return gql` + subscription($networkId: String!) { + blockAdded(networkId: $networkId) { + height + chainId + } + } + ` + }, + result() { + refetchNetworkOnly(this.$apollo.queries.overview) + } } } } diff --git a/src/components/staking/LiValidator.vue b/src/components/staking/LiValidator.vue index 356486877f..cb00591439 100644 --- a/src/components/staking/LiValidator.vue +++ b/src/components/staking/LiValidator.vue @@ -62,7 +62,6 @@