From f65122b68e1e3b1d31d9d67a11a20676c9d9f78a Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Sun, 10 Jul 2022 22:04:45 +0530 Subject: [PATCH 1/3] fixed reef bugs --- .../participant/ActionInputs/ReefErc20.vue | 54 +++++++++++-------- .../participant/ActionInputs/ReefErc721.vue | 42 +++++++++++---- src/views/admin/Events.vue | 19 ++++--- stage.env | 16 ++++++ 4 files changed, 89 insertions(+), 42 deletions(-) create mode 100644 stage.env diff --git a/src/components/participant/ActionInputs/ReefErc20.vue b/src/components/participant/ActionInputs/ReefErc20.vue index 6389fb32..21b38740 100644 --- a/src/components/participant/ActionInputs/ReefErc20.vue +++ b/src/components/participant/ActionInputs/ReefErc20.vue @@ -40,26 +40,34 @@ v-model="value.userWalletAddress" :disabled="done" :required="data.isManadatory" + v-if="!done" > + - + v-else> - - + + + @@ -111,7 +119,7 @@ export default { signature: "", message_sign: "You are Signing this Message to confirm your Paricipation", - options:[{value: '', text: 'Please select your reef wallet'}], + options:[{value: '', text: 'Please select your Reef wallet'}], value: { contractAddress: "", userWalletAddress: '', @@ -132,11 +140,7 @@ export default { Object.assign(this.value, { ...(this.data.value) }); } eventBus.$on(`disableInput${this.data._id}`, this.disableInput); - - // TODO: need to check if this works await this.checkWeb3Injection(); - await this.invokeReef() - await this.fetchAccounts() }, methods: { async checkWeb3Injection() { @@ -157,32 +161,27 @@ export default { }, async fetchAccounts() { + this.options = [{value: '', text: 'Please select your Reef wallet.'}]; for (let i in this.wallet) { this.options.push({value:this.wallet[i],text: 'Address: '+ this.wallet[i].address.slice(0,12)+'...'+this.wallet[i].address.slice(38,48)+' Name: '+this.wallet[i].name}) } + + this.value.userWalletAddress = this.options[1]? this.options[1].value : this.options[0].value }, async invokeReef() { try { - if (this.web3 && this.web3.reef) { + if (this.web3 && this.web3.reef) { let sign; await window.injectedWeb3.reef.enable() .then(async walletObj=>{ this.wallet = await walletObj.accounts.get(); this.walletSignObj=walletObj + await this.fetchAccounts(); }) - - - - - - // const walletAddr= await wallet.get - - - } } catch (error) { return this.notifyErr(error.message) @@ -225,7 +224,16 @@ export default { return true; }, async fetchBalance() { - + + if(!this.value.contractAddress){ + throw new Error("Missing contract address") + } + + if(!this.value.userWalletAddress.address){ + throw new Error("Missing userWallet address") + } + + this.signature=await this.walletSignObj.signer.signRaw(this.value.userWalletAddress) const body = { actionType: this.data.type, diff --git a/src/components/participant/ActionInputs/ReefErc721.vue b/src/components/participant/ActionInputs/ReefErc721.vue index 0e73f64a..1e457591 100644 --- a/src/components/participant/ActionInputs/ReefErc721.vue +++ b/src/components/participant/ActionInputs/ReefErc721.vue @@ -40,26 +40,34 @@ v-model="value.userWalletAddress" :disabled="done" :required="data.isManadatory" + v-if="!done" > + - + v-else> - - + + + @@ -111,7 +119,7 @@ export default { signature: "", message_sign: "You are Signing this Message to confirm your Paricipation", - options:[{value: '', text: 'Please select your reef wallet'}], + options:[{value: '', text: 'Please select your Reef wallet'}], value: { contractAddress: "", userWalletAddress: '', @@ -133,9 +141,7 @@ export default { Object.assign(this.value, { ...(this.data.value) }); } eventBus.$on(`disableInput${this.data._id}`, this.disableInput); - this.checkWeb3Injection(); - await this.invokeReef() - await this.fetchAccounts() + await this.checkWeb3Injection(); }, methods: { async checkWeb3Injection() { @@ -156,10 +162,13 @@ export default { }, async fetchAccounts() { + this.options = [{value: '', text: 'Please select your reef wallet'}]; for (let i in this.wallet) { this.options.push({value:this.wallet[i],text: 'Address: '+ this.wallet[i].address.slice(0,12)+'...'+this.wallet[i].address.slice(38,48)+' Name: '+this.wallet[i].name}) } + + this.value.userWalletAddress = this.options[1]? this.options[1].value : this.options[0].value }, async invokeReef() { try { @@ -171,6 +180,7 @@ export default { .then(async walletObj=>{ this.wallet = await walletObj.accounts.get(); this.walletSignObj=walletObj + await this.fetchAccounts(); }) @@ -224,6 +234,16 @@ export default { return true; }, async fetchBalance() { + + if(!this.value.contractAddress){ + throw new Error("Missing contract address") + } + + if(!this.value.userWalletAddress.address){ + throw new Error("Missing userWallet address") + } + + this.signature=await this.walletSignObj.signer.signRaw(this.value.userWalletAddress) const body = { diff --git a/src/views/admin/Events.vue b/src/views/admin/Events.vue index 48c49cb9..f227ed32 100644 --- a/src/views/admin/Events.vue +++ b/src/views/admin/Events.vue @@ -1137,14 +1137,17 @@ export default { ); localStorage.removeItem("userProjects"); - tempProject.projects.splice(index, 1); - localStorage.setItem( - "userProjects", - JSON.stringify({ - projects: tempProject.projects, - count: tempProject.projects.length, - }) - ); + if(tempProject){ + tempProject.projects.splice(index, 1); + localStorage.setItem( + "userProjects", + JSON.stringify({ + projects: tempProject.projects, + count: tempProject.projects.length, + }) + ); + } + if (json) { if (!resp.ok) { return this.notifyErr(json); diff --git a/stage.env b/stage.env new file mode 100644 index 00000000..15f43c19 --- /dev/null +++ b/stage.env @@ -0,0 +1,16 @@ +NODE_ENV=production +VUE_APP_AUTH0_CLIENT_ID=hwM9GmM4nUstds9Fw5KsYZVDboJBeLTL +VUE_APP_AUTH0_DOMAIN=hyperfyre-dev.us.auth0.com +VUE_APP_IS_TEZOS=true +VUE_APP_MOBILEWALLET_URL=hypersign +VUE_APP_RECAPTCHA_SITE_KEY=6LeKIM4ZAAAAAC23tPRa8Ut0MFF2FFN61wl0ihVZ +VUE_APP_SERVER_WEBSOCKET_URL=wss://stage.hypermine.in/whitelistws/ +VUE_APP_STUDIO_SERVER_BASE_URL=https://stage.hypermine.in/whitelist/ +VUE_APP_TELEGRAM_BOT_ID=1891351040 +VUE_APP_TITLE=Whitelisting hypersign +VUE_APP_VERSION=v3.0.4 +VUE_APP_WEBWALLET_URL=https://hswallet-stage.netlify.app +VUE_APP_INVESTOR_API_SECRET_KEY=a8be7e97656ff81566936ca15755e0341528be0cbec937be +VUE_APP_GA_CODE=GTM-5XV9VBF +VUE_APP_KOMMINICATE_APP_ID=1375a991e076a0cb9bbe05bfea0f7aa53 +VUE_APP_ZOHO_WIDGET_CODE=280645b58506e84fd7b55a5428ccef6df9ed4583b07a1ee7edf840bff992abdde27671f53b3573df4769c61a817e82a2 From c21947d46d932a4efa3d9180b5ffd6594a92aac2 Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Sun, 10 Jul 2022 22:06:07 +0530 Subject: [PATCH 2/3] fixed reef bug --- prod.env | 16 ++++++++++++++++ stage.env | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 prod.env delete mode 100644 stage.env diff --git a/prod.env b/prod.env new file mode 100644 index 00000000..c2beba36 --- /dev/null +++ b/prod.env @@ -0,0 +1,16 @@ +NODE_ENV=production +VUE_APP_AUTH0_CLIENT_ID=Mo98qDLrZuOOa2TATig5qNzngwRpJCJk +VUE_APP_AUTH0_DOMAIN=hyperfyre-dev.us.auth0.com +VUE_APP_MOBILEWALLET_URL=hypersign +VUE_APP_RECAPTCHA_SITE_KEY=6LeKIM4ZAAAAAC23tPRa8Ut0MFF2FFN61wl0ihVZ +VUE_APP_SERVER_WEBSOCKET_URL=wss://api.fyre.hypersign.id/ws/ +VUE_APP_STUDIO_SERVER_BASE_URL=https://api.fyre.hypersign.id/ +VUE_APP_TELEGRAM_BOT_ID=2136538813 +VUE_APP_TELEGRAM_VERIFIER_BOT=hyperfyre_bot +VUE_APP_TITLE=Fyre +VUE_APP_VERSION=v5.6.0 +VUE_APP_WEBWALLET_URL=https://wallet.hypersign.id +VUE_APP_GA_CODE=GTM-5XV9VBF +VUE_APP_KOMMINICATE_APP_ID=482503809608fa05d3bcfc384edba263 +VUE_APP_WEBPUSH_VAPID_PUBLIC_KEY=BAJF9hFTnNOu7Mc_jYvEFsk5d24UlwW8AwfgR5lFQFxttsgIQXP9PR97-QWP015Gc9AWR8fVFKyMDePR8rQEoEo +VUE_APP_INVESTOR_API_SECRET_KEY=a8be7e97656ff81566936ca15755e0341528be0cbec937be diff --git a/stage.env b/stage.env deleted file mode 100644 index 15f43c19..00000000 --- a/stage.env +++ /dev/null @@ -1,16 +0,0 @@ -NODE_ENV=production -VUE_APP_AUTH0_CLIENT_ID=hwM9GmM4nUstds9Fw5KsYZVDboJBeLTL -VUE_APP_AUTH0_DOMAIN=hyperfyre-dev.us.auth0.com -VUE_APP_IS_TEZOS=true -VUE_APP_MOBILEWALLET_URL=hypersign -VUE_APP_RECAPTCHA_SITE_KEY=6LeKIM4ZAAAAAC23tPRa8Ut0MFF2FFN61wl0ihVZ -VUE_APP_SERVER_WEBSOCKET_URL=wss://stage.hypermine.in/whitelistws/ -VUE_APP_STUDIO_SERVER_BASE_URL=https://stage.hypermine.in/whitelist/ -VUE_APP_TELEGRAM_BOT_ID=1891351040 -VUE_APP_TITLE=Whitelisting hypersign -VUE_APP_VERSION=v3.0.4 -VUE_APP_WEBWALLET_URL=https://hswallet-stage.netlify.app -VUE_APP_INVESTOR_API_SECRET_KEY=a8be7e97656ff81566936ca15755e0341528be0cbec937be -VUE_APP_GA_CODE=GTM-5XV9VBF -VUE_APP_KOMMINICATE_APP_ID=1375a991e076a0cb9bbe05bfea0f7aa53 -VUE_APP_ZOHO_WIDGET_CODE=280645b58506e84fd7b55a5428ccef6df9ed4583b07a1ee7edf840bff992abdde27671f53b3573df4769c61a817e82a2 From 5642630ad08c984c021dcd7fb10aa1e2604f1732 Mon Sep 17 00:00:00 2001 From: vishwas1 Date: Sun, 10 Jul 2022 22:09:54 +0530 Subject: [PATCH 3/3] by mistake --- .gitignore | 2 ++ prod.env | 16 ---------------- prod.env.txt | 18 ------------------ 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 prod.env delete mode 100755 prod.env.txt diff --git a/.gitignore b/.gitignore index cb7bb513..182f2925 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,8 @@ coverage # nyc test coverage .nyc_output +*.env + # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt diff --git a/prod.env b/prod.env deleted file mode 100644 index c2beba36..00000000 --- a/prod.env +++ /dev/null @@ -1,16 +0,0 @@ -NODE_ENV=production -VUE_APP_AUTH0_CLIENT_ID=Mo98qDLrZuOOa2TATig5qNzngwRpJCJk -VUE_APP_AUTH0_DOMAIN=hyperfyre-dev.us.auth0.com -VUE_APP_MOBILEWALLET_URL=hypersign -VUE_APP_RECAPTCHA_SITE_KEY=6LeKIM4ZAAAAAC23tPRa8Ut0MFF2FFN61wl0ihVZ -VUE_APP_SERVER_WEBSOCKET_URL=wss://api.fyre.hypersign.id/ws/ -VUE_APP_STUDIO_SERVER_BASE_URL=https://api.fyre.hypersign.id/ -VUE_APP_TELEGRAM_BOT_ID=2136538813 -VUE_APP_TELEGRAM_VERIFIER_BOT=hyperfyre_bot -VUE_APP_TITLE=Fyre -VUE_APP_VERSION=v5.6.0 -VUE_APP_WEBWALLET_URL=https://wallet.hypersign.id -VUE_APP_GA_CODE=GTM-5XV9VBF -VUE_APP_KOMMINICATE_APP_ID=482503809608fa05d3bcfc384edba263 -VUE_APP_WEBPUSH_VAPID_PUBLIC_KEY=BAJF9hFTnNOu7Mc_jYvEFsk5d24UlwW8AwfgR5lFQFxttsgIQXP9PR97-QWP015Gc9AWR8fVFKyMDePR8rQEoEo -VUE_APP_INVESTOR_API_SECRET_KEY=a8be7e97656ff81566936ca15755e0341528be0cbec937be diff --git a/prod.env.txt b/prod.env.txt deleted file mode 100755 index 7d3b9276..00000000 --- a/prod.env.txt +++ /dev/null @@ -1,18 +0,0 @@ -NODE_ENV=production -VUE_APP_AUTH0_CLIENT_ID=Mo98qDLrZuOOa2TATig5qNzngwRpJCJk -VUE_APP_AUTH0_DOMAIN=hyperfyre-dev.us.auth0.com -VUE_APP_MOBILEWALLET_URL=hypersign -VUE_APP_RECAPTCHA_SITE_KEY=6LeKIM4ZAAAAAC23tPRa8Ut0MFF2FFN61wl0ihVZ -VUE_APP_SERVER_WEBSOCKET_URL=wss://api.fyre.hypersign.id/ws/ -VUE_APP_STUDIO_SERVER_BASE_URL=https://api.fyre.hypersign.id/ -VUE_APP_TELEGRAM_BOT_ID=2136538813 -VUE_APP_TELEGRAM_VERIFIER_BOT=hyperfyre_bot -VUE_APP_TITLE=Hyperfyre -VUE_APP_VERSION=v5.3.0 -VUE_APP_WEBWALLET_URL=https://wallet.hypersign.id -VUE_APP_GA_CODE=GTM-5XV9VBF -VUE_APP_KOMMINICATE_APP_ID=482503809608fa05d3bcfc384edba263 -VUE_APP_WEBPUSH_VAPID_PUBLIC_KEY=BAJF9hFTnNOu7Mc_jYvEFsk5d24UlwW8AwfgR5lFQFxttsgIQXP9PR97-QWP015Gc9AWR8fVFKyMDePR8rQEoEo - - -