From a0040e035c3dfbf57eda6eee7c8cd6d07ba3df8c Mon Sep 17 00:00:00 2001 From: Chibuotu Amadi Date: Mon, 18 Jan 2021 17:16:00 +0100 Subject: [PATCH 1/3] remove autofill --- app/assets/v2/js/pages/hackathon_new_bounty.js | 5 ----- app/assets/v2/js/pages/new_bounty.js | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/app/assets/v2/js/pages/hackathon_new_bounty.js b/app/assets/v2/js/pages/hackathon_new_bounty.js index 259bd80f829..263a2ba84b6 100644 --- a/app/assets/v2/js/pages/hackathon_new_bounty.js +++ b/app/assets/v2/js/pages/hackathon_new_bounty.js @@ -62,11 +62,6 @@ Vue.mixin({ }); }, - getBinanceSelectedAccount: async function() { - let vm = this; - - vm.form.funderAddress = await binance_utils.getSelectedAccount(); - }, getAmount: function(token) { let vm = this; diff --git a/app/assets/v2/js/pages/new_bounty.js b/app/assets/v2/js/pages/new_bounty.js index b19ab7a21ef..f80a92aeb98 100644 --- a/app/assets/v2/js/pages/new_bounty.js +++ b/app/assets/v2/js/pages/new_bounty.js @@ -74,11 +74,6 @@ Vue.mixin({ }); }, - getBinanceSelectedAccount: async function() { - let vm = this; - - vm.form.funderAddress = await binance_utils.getSelectedAccount(); - }, getAmount: function(token) { let vm = this; @@ -696,11 +691,6 @@ Vue.mixin({ if (!provider && val === '1') { await onConnect(); } - - if (val === '56') { - this.getBinanceSelectedAccount(); - } - this.getTokens(); } } From 5f7bae654cb7b43de05ed655f88bfe08a1fbef33 Mon Sep 17 00:00:00 2001 From: Chibuotu Amadi Date: Tue, 19 Jan 2021 01:23:07 +0100 Subject: [PATCH 2/3] make manual address input a fallback --- app/assets/v2/js/pages/hackathon_new_bounty.js | 14 ++++++++++++++ app/assets/v2/js/pages/new_bounty.js | 15 +++++++++++++++ app/dashboard/templates/bounty/new_bounty.html | 6 +++++- .../templates/dashboard/hackathon/new_bounty.html | 8 ++++++-- 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/app/assets/v2/js/pages/hackathon_new_bounty.js b/app/assets/v2/js/pages/hackathon_new_bounty.js index 263a2ba84b6..97b42450782 100644 --- a/app/assets/v2/js/pages/hackathon_new_bounty.js +++ b/app/assets/v2/js/pages/hackathon_new_bounty.js @@ -62,6 +62,15 @@ Vue.mixin({ }); }, + getBinanceSelectedAccount: async function() { + let vm = this; + + try { + vm.form.funderAddress = await binance_utils.getSelectedAccount(); + } catch (error) { + vm.funderAddressFallback = true; + } + }, getAmount: function(token) { let vm = this; @@ -364,6 +373,11 @@ Vue.mixin({ if (!provider && val === '1') { await onConnect(); } + + if (val === '56') { + this.getBinanceSelectedAccount(); + } + this.getTokens(); await this.checkForm(); } diff --git a/app/assets/v2/js/pages/new_bounty.js b/app/assets/v2/js/pages/new_bounty.js index f80a92aeb98..1b9abadedb5 100644 --- a/app/assets/v2/js/pages/new_bounty.js +++ b/app/assets/v2/js/pages/new_bounty.js @@ -74,6 +74,15 @@ Vue.mixin({ }); }, + getBinanceSelectedAccount: async function() { + let vm = this; + + try { + vm.form.funderAddress = await binance_utils.getSelectedAccount(); + } catch (error) { + vm.funderAddressFallback = true; + } + }, getAmount: function(token) { let vm = this; @@ -691,6 +700,11 @@ Vue.mixin({ if (!provider && val === '1') { await onConnect(); } + + if (val === '56') { + this.getBinanceSelectedAccount(); + } + this.getTokens(); } } @@ -709,6 +723,7 @@ if (document.getElementById('gc-hackathon-new-bounty')) { tokens: [], network: 'mainnet', chainId: '', + funderAddressFallback: false, checkboxes: {'terms': false, 'termsPrivacy': false, 'neverExpires': true, 'hiringRightNow': false }, expandedGroup: {'reserve': [], 'featuredBounty': []}, errors: {}, diff --git a/app/dashboard/templates/bounty/new_bounty.html b/app/dashboard/templates/bounty/new_bounty.html index 57d47a8ef33..884cbb60ff6 100644 --- a/app/dashboard/templates/bounty/new_bounty.html +++ b/app/dashboard/templates/bounty/new_bounty.html @@ -417,12 +417,16 @@

Fund Issue

-
+
+

Please enter your Binance Wallet address. We are unable to validate a Binance address. Please confirm that you are using the correct Binance address.

[[errors.funderAddress]]
+
+ Looks like you don't have the Binance Wallet Extension or the extension is disabled. +
diff --git a/app/dashboard/templates/dashboard/hackathon/new_bounty.html b/app/dashboard/templates/dashboard/hackathon/new_bounty.html index 22ea14bd508..44ae9502637 100644 --- a/app/dashboard/templates/dashboard/hackathon/new_bounty.html +++ b/app/dashboard/templates/dashboard/hackathon/new_bounty.html @@ -438,12 +438,16 @@

Fund Prize

-
- +
+ +

Please enter your Binance Wallet address. We are unable to validate a Binance address. Please confirm that you are using the correct Binance address.

[[errors.funderAddress]]
+
+ Looks like you don't have the Binance Wallet Extension or the extension is disabled. +
From eeee9ddf10b44b5111d7dbf097d75afe557345c7 Mon Sep 17 00:00:00 2001 From: Chibuotu Amadi Date: Tue, 19 Jan 2021 01:46:29 +0100 Subject: [PATCH 3/3] fix funderAddressFallback model field to hackathon --- app/assets/v2/js/pages/hackathon_new_bounty.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/v2/js/pages/hackathon_new_bounty.js b/app/assets/v2/js/pages/hackathon_new_bounty.js index 97b42450782..f08f3308a30 100644 --- a/app/assets/v2/js/pages/hackathon_new_bounty.js +++ b/app/assets/v2/js/pages/hackathon_new_bounty.js @@ -396,6 +396,7 @@ if (document.getElementById('gc-hackathon-new-bounty')) { tokens: [], network: 'mainnet', chainId: '', + funderAddressFallback: false, terms: false, hackathonSlug: document.hackathon.slug, hackathonEndDate: document.hackathon.endDate,