From eced42806d475de267a33e5cdb02d379881c8f24 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Thu, 10 May 2018 12:23:44 +0900 Subject: [PATCH] Fix - 315 - Currency search doesn't work when entering from Settings --- src/js/controllers/preferencesAltCurrency.js | 5 ++++- www/views/preferencesAltCurrency.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/js/controllers/preferencesAltCurrency.js b/src/js/controllers/preferencesAltCurrency.js index fcb2c0b4c..fdfd69c1a 100644 --- a/src/js/controllers/preferencesAltCurrency.js +++ b/src/js/controllers/preferencesAltCurrency.js @@ -68,8 +68,11 @@ angular.module('copayApp.controllers').controller('preferencesAltCurrencyControl }; $scope.findCurrency = function(search) { + console.log(search); if (!search) init(); - $scope.altCurrencyList = lodash.filter(completeAlternativeList, function(item) { + console.log(search); + var list = lodash.unique(lodash.union(completeAlternativeList, lodash.union($scope.lastUsedAltCurrencyList, popularCurrencyList)), 'isoCode'); + $scope.altCurrencyList = lodash.filter(list, function(item) { var val = item.name var val2 = item.isoCode; return lodash.includes(val.toLowerCase(), search.toLowerCase()) || lodash.includes(val2.toLowerCase(), search.toLowerCase()); diff --git a/www/views/preferencesAltCurrency.html b/www/views/preferencesAltCurrency.html index f6d8cb74d..68a40eabd 100644 --- a/www/views/preferencesAltCurrency.html +++ b/www/views/preferencesAltCurrency.html @@ -14,7 +14,7 @@ placeholder="{{'Search your currency' | translate}}"> -
+
{{lastUsedAltCurrency.name}} {{lastUsedAltCurrency.isoCode}}