From 09566af448ef075a52880fe2ace869a6b2baa2df Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Fri, 18 May 2018 14:21:38 +0900 Subject: [PATCH] Fix - 322 - Fix >= -> === --- src/js/controllers/modals/search.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/js/controllers/modals/search.js b/src/js/controllers/modals/search.js index 17b759226..6612da6e8 100644 --- a/src/js/controllers/modals/search.js +++ b/src/js/controllers/modals/search.js @@ -53,7 +53,7 @@ angular.module('copayApp.controllers').controller('searchController', function($ }); if (search) { - if ((search.indexOf('bitcoincash:') >= 0 || search[0] === 'C' || search[0] === 'H' || search[0] === 'p' || search[0] === 'q') && search.replace('bitcoincash:', '').length === 42) { // CashAddr + if ((search.indexOf('bitcoincash:') === 0 || search[0] === 'C' || search[0] === 'H' || search[0] === 'p' || search[0] === 'q') && search.replace('bitcoincash:', '').length === 42) { // CashAddr $scope.searchTermIsAddress = true; } else if ((search[0] === "1" || search[0] === "3" || search.substring(0, 3) === "bc1") && search.length >= 26 && search.length <= 35) { // Legacy Addresses $scope.searchTermIsAddress = true; @@ -91,12 +91,12 @@ angular.module('copayApp.controllers').controller('searchController', function($ }; $scope.searchOnBlockchain = function(searchTerm) { - var url = 'https://explorer.bitcoin.com/'+$scope.wallet.coin+'/search/' + searchTerm; - var optIn = true; - var title = null; - var message = gettextCatalog.getString('Search on Explorer.Bitcoin.com'); - var okText = gettextCatalog.getString('Open Explorer'); - var cancelText = gettextCatalog.getString('Go Back'); + const url = 'https://explorer.bitcoin.com/'+$scope.wallet.coin+'/search/' + searchTerm; + const optIn = true; + const title = null; + const message = gettextCatalog.getString('Search on Explorer.Bitcoin.com'); + const okText = gettextCatalog.getString('Open Explorer'); + const cancelText = gettextCatalog.getString('Go Back'); externalLinkService.open(url, optIn, title, message, okText, cancelText); };