From 3b84fc1a06d7f7c6abde4eda0c3d44ace34711de Mon Sep 17 00:00:00 2001 From: Jonathan Cobb Date: Tue, 14 Jul 2020 09:25:57 -0400 Subject: [PATCH] poll for verified contacts so page refreshes upon verification --- src/account/NewNetworkPage.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/account/NewNetworkPage.vue b/src/account/NewNetworkPage.vue index 5c042c2..bf6e65f 100644 --- a/src/account/NewNetworkPage.vue +++ b/src/account/NewNetworkPage.vue @@ -425,6 +425,7 @@ creating: false }, verifiedContacts: null, + verifiedContactRefresher: null, anyContacts: null, firstContact: null, payMethods: null, @@ -774,6 +775,20 @@ this.anyContacts = this.hasAnyContacts(p); this.verifiedContacts = this.hasVerifiedContact(p); this.firstContact = this.getFirstContact(p); + if (!this.verifiedContacts) { + if (this.verifiedContactRefresher === null) { + const vue = this; + const currentUser = util.currentUser(); + this.verifiedContactRefresher = window.setInterval(() => { + vue.getPolicyByUserId({userId: currentUser.uuid, messages: vue.messages, errors: vue.errors}); + }, 5000); + } + } else { + if (this.verifiedContactRefresher !== null) { + window.clearInterval(this.verifiedContactRefresher); + this.verifiedContactRefresher = null; + } + } }, actionStatus (status) { if (status.success) {