Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Commit 649bfc4

Browse files
[FIX] remove unused code
do not create unneeded orderbooks
1 parent d5aa2bd commit 649bfc4

File tree

3 files changed

+47
-285
lines changed

3 files changed

+47
-285
lines changed

src/js/controllers/app.controller.js

+2-25
Original file line numberDiff line numberDiff line change
@@ -695,28 +695,16 @@ function AppCtrl ($scope, id, net, keychain, txQueue, appManager, rpTracker,
695695
store.set('ripple_pairs_all',require('../data/pairs'));
696696
}
697697

698-
var pairs_all = store.get('ripple_pairs_all');
698+
// var pairs_all = store.get('ripple_pairs_all');
699699
var pairs_default = require('../data/pairs');
700-
$scope.pairs_all = genericUtils.uniqueObjArray(pairs_all, pairs_default, 'name');
700+
$scope.default_trade_pair = pairs_default[0].name;
701701

702702
function compare(a, b) {
703703
if (a.order < b.order) return 1;
704704
if (a.order > b.order) return -1;
705705
return 0;
706706
}
707707

708-
// sort currencies and pairs by order
709-
$scope.currencies_all.sort(compare);
710-
711-
function compare_last_used(a, b) {
712-
var time_a = a.last_used || a.order || 0;
713-
var time_b = b.last_used || b.order || 0;
714-
if (time_a < time_b) return 1;
715-
if (time_a > time_b) return -1;
716-
return 0;
717-
}
718-
$scope.pairs_all.sort(compare_last_used);
719-
720708
$scope.currencies_all_keyed = {};
721709
_.each($scope.currencies_all, function(currency){
722710
$scope.currencies_all_keyed[currency.value] = currency;
@@ -732,17 +720,6 @@ function AppCtrl ($scope, id, net, keychain, txQueue, appManager, rpTracker,
732720
currenciesAllWatcher();
733721
}, true);
734722

735-
var pairsAllWatcher = $scope.$watch('pairs_all', function(){
736-
if (!$scope.pairs_all.length) return;
737-
738-
if (!store.disabled) {
739-
store.set('ripple_pairs_all',$scope.pairs_all);
740-
}
741-
742-
pairsAllWatcher();
743-
}, true);
744-
745-
$scope.pairs = $scope.pairs_all.slice(1);
746723
$timeout(function() {
747724
$scope.app_loaded = 'loaded';
748725
$("body").removeClass("loading");

0 commit comments

Comments
 (0)