ianleggett / TinanceUI

0 stars 0 forks source link

Buy/Sell logic is wrong on Markets page #71

Open ianleggett opened 3 years ago

ianleggett commented 3 years ago

On Markets page ONLY, when not logged in: All offers should be listed as OPPOSITE logic. For example an offer has 'buyer' == true, then show as a SELL offer and conversely for buyer==false.

When a user is logged in, this reverse logic still applies - except if the logged in user == userDetails then the logic is normal, i.e buyer==true then its a buy.

The filter also has an issue:

buysell-logic

ianleggett commented 3 years ago
if (( profile )&&( trade.userDetails.cid === profile.cid )) {
     // this order is the users, return normal logic
     return trade.buyer;
} else { 
      // not logged in or not users order, return opposite
  return  ( ! trade.buyer )
}