Fix - 322 - Fix >= -> ===

This commit is contained in:
Jean-Baptiste Dominguez 2018-05-18 14:21:38 +09:00
commit 09566af448

View file

@ -53,7 +53,7 @@ angular.module('copayApp.controllers').controller('searchController', function($
}); });
if (search) { 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; $scope.searchTermIsAddress = true;
} else if ((search[0] === "1" || search[0] === "3" || search.substring(0, 3) === "bc1") && search.length >= 26 && search.length <= 35) { // Legacy Addresses } else if ((search[0] === "1" || search[0] === "3" || search.substring(0, 3) === "bc1") && search.length >= 26 && search.length <= 35) { // Legacy Addresses
$scope.searchTermIsAddress = true; $scope.searchTermIsAddress = true;
@ -91,12 +91,12 @@ angular.module('copayApp.controllers').controller('searchController', function($
}; };
$scope.searchOnBlockchain = function(searchTerm) { $scope.searchOnBlockchain = function(searchTerm) {
var url = 'https://explorer.bitcoin.com/'+$scope.wallet.coin+'/search/' + searchTerm; const url = 'https://explorer.bitcoin.com/'+$scope.wallet.coin+'/search/' + searchTerm;
var optIn = true; const optIn = true;
var title = null; const title = null;
var message = gettextCatalog.getString('Search on Explorer.Bitcoin.com'); const message = gettextCatalog.getString('Search on Explorer.Bitcoin.com');
var okText = gettextCatalog.getString('Open Explorer'); const okText = gettextCatalog.getString('Open Explorer');
var cancelText = gettextCatalog.getString('Go Back'); const cancelText = gettextCatalog.getString('Go Back');
externalLinkService.open(url, optIn, title, message, okText, cancelText); externalLinkService.open(url, optIn, title, message, okText, cancelText);
}; };