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

Commit

Permalink
[FIX] do not create orderbook if pairs are same
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdarkdragon committed Sep 1, 2015
1 parent b40ec7b commit c1fc2b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/js/tabs/trade.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,17 +1131,25 @@ TradeTab.prototype.angular = function(module)
return;
}

order.valid_settings = true;

// Remember pair
// Produces currency/issuer:currency/issuer
var key = '' +
var keyFirst = '' +
order.first_currency.to_json() +
(order.first_currency.is_native() ? '' : '/' + order.first_issuer) +
':' +
(order.first_currency.is_native() ? '' : '/' + order.first_issuer);
var keySecond = '' +
order.second_currency._iso_code +
(order.second_currency.is_native() ? '' : '/' + order.second_issuer);

if (keyFirst === keySecond) {
order.valid_settings = false;
return;
}

var key = keyFirst + ':' + keySecond;

order.valid_settings = true;

var changedPair = false;
// Load orderbook
if (order.prev_settings !== key) {
Expand Down

0 comments on commit c1fc2b2

Please sign in to comment.