diff --git a/www/js/controllers/wot-controllers.js b/www/js/controllers/wot-controllers.js index f4f30d055ed0e5bd5b32610376380dc1ce8c19d4..b7d9cd2c2b31cfbaa38f359d0c9eae164a11a8f6 100644 --- a/www/js/controllers/wot-controllers.js +++ b/www/js/controllers/wot-controllers.js @@ -295,7 +295,7 @@ function WotLookupController($scope, $state, $q, $timeout, $focus, $location, $i $scope.search.type = 'text'; // If checksum is correct, search on simple pubkey - let pubkey_ck; + let pubkeyWithCk; if (BMA.regexp.PUBKEY_WITH_CHECKSUM.test(text)) { console.debug("[wot] Validating pubkey checksum... "); let matches = BMA.regexp.PUBKEY_WITH_CHECKSUM.exec(text); @@ -306,14 +306,15 @@ function WotLookupController($scope, $state, $q, $timeout, $focus, $location, $i if (checksum === expectedChecksum) { console.debug("[wot] checksum {" + checksum + "} valid for pubkey {" + pubkey + "}") text = pubkey - pubkey_ck = pubkey + ':' + checksum + pubkeyWithCk = pubkey + ':' + checksum } } return csWot.search(text) .then(function(idties){ if ($scope.search.type !== 'text') return; // could have change - if (! $scope.search.text.trim() in [text, pubkey_ck] ) return; // search text has changed before received response + originText = $scope.search.text.trim(); + if (originText !== text && originText !== pubkeyWithCk) return; // search text has changed before received response if ((!idties || !idties.length) && (BMA.regexp.PUBKEY.test(text) || BMA.regexp.PUBKEY_WITH_CHECKSUM.test(text))) { return BMA.uri.parse(text)