<commit_before>angular.module("omniControllers")
	.controller("DExOverviewController", ["$scope","userService","Orderbook","TransactionManager",
		function DExOverviewController($scope,userService,Orderbook,TransactionManager){
			$scope.isLoggedIn = userService.loggedIn();
			$scope.orderbooks = [];

			var DExSaleTransaction = new TransactionManager(21);

			$scope.switchOrderbook = function(propertyId){
				var active = null;
				var selected = null;
				$scope.orderbooks.forEach(function(orderbook){
					if(orderbook.tradingPair.property == propertyId)
						selected = orderbook;
					if(orderbook.active)
						active=orderbook;
				});
				if(selected==null){
					var tradingPair = {property:propertyId,pair: propertyId < 2147483651 ? 1 : 2};
					selected = new Orderbook(DExSaleTransaction, tradingPair)
					$scope.orderbooks.push(selected);
				}
				if (active && active!= selected)
					active.active=false;
			}
	}]);<commit_msg>Fix orderbook selection<commit_after>angular.module("omniControllers")
	.controller("DExOverviewController", ["$scope","userService","Orderbook","TransactionManager",
		function DExOverviewController($scope,userService,Orderbook,TransactionManager){
			$scope.isLoggedIn = userService.loggedIn();
			$scope.orderbooks = [];

			var DExSaleTransaction = new TransactionManager(21);

			$scope.switchOrderbook = function(propertyId){
				var active = null;
				var selected = null;
				$scope.orderbooks.forEach(function(orderbook){
					if(orderbook.tradingPair.property == propertyId)
						selected = orderbook;
					if(orderbook.active)
						active=orderbook;
				});
				if(selected==null){
					var tradingPair = {property:propertyId,pair: propertyId < 2147483651 ? 1 : 2};
					selected = new Orderbook(DExSaleTransaction, tradingPair)
					$scope.orderbooks.push(selected);
				} else {
					selected.active = true;
				}
				if (active && active!= selected)
					active.active=false;
			}
	}]);
{'fraction_non_alphanumeric': 0.12961065573770492, 'fraction_numerical': 0.014344262295081968, 'mean_word_length': 4.501408450704226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6806130', 'n_tokens_mistral': 736, 'n_tokens_neox': 572, 'n_words': 95}