Skip to content

Commit

Permalink
Hiding PK roles from the account balances tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
merivale committed May 12, 2021
1 parent abc06b5 commit d460963
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions marlowe-dashboard-client/src/Contract/View.purs
Expand Up @@ -17,7 +17,7 @@ import Data.BigInteger (BigInteger, fromInt, fromString)
import Data.Foldable (foldMap)
import Data.FunctorWithIndex (mapWithIndex)
import Data.Lens ((^.))
import Data.Map as Map
import Data.Map (filterKeys, keys, lookup, toUnfoldable) as Map
import Data.Maybe (Maybe(..), maybe, maybe')
import Data.Set (Set)
import Data.Set as Set
Expand Down Expand Up @@ -677,7 +677,13 @@ renderBalances state accounts =
-- TODO: Right now we only have one type of Token (ada), but when we support multiple tokens we may want to group by
-- participant and show the different tokens for each participant.
accounts' :: Array (Tuple (Tuple Party Token) BigInteger)
accounts' = Map.toUnfoldable accounts
accounts' = Map.toUnfoldable $ Map.filterKeys isRoleAccount accounts

-- Note we are currently filtering out PK accounts. We have no nice way to display them, and we are only using them
-- in one special case where it is confusing to display them anyway.
isRoleAccount (accountId /\ token) = case accountId of
Role _ -> true
_ -> false
in
div [ classNames [ "text-xs" ] ]
( append
Expand Down

0 comments on commit d460963

Please sign in to comment.