From fd5ea2f864998ffb108f04fafe0107dc5f1b6090 Mon Sep 17 00:00:00 2001 From: Michael Harding Date: Thu, 23 Jan 2020 16:49:04 -0500 Subject: [PATCH] SP-54: Apply filters after md change --- src/web/ui/src/Reports/State.fs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/web/ui/src/Reports/State.fs b/src/web/ui/src/Reports/State.fs index 30b2506ee..742be322e 100644 --- a/src/web/ui/src/Reports/State.fs +++ b/src/web/ui/src/Reports/State.fs @@ -381,7 +381,7 @@ let update msg (model:Reports.Types.Model) : Model * Cmd = let secs:(uint32 * PositionSecurity) list = data |> List.ofArray - |> List.collect (fun i -> + |> List.collect (fun i -> JSMap.toList i.names |> List.map (fun x -> (uint32 <| fst x), @@ -393,7 +393,11 @@ let update msg (model:Reports.Types.Model) : Model * Cmd = ) ) - { model with mdRelayExpNameData = data; securityList = secs |> Map.ofList }, selectSub None model + { model with mdRelayExpNameData = data; securityList = secs |> Map.ofList }, + Cmd.batch ( + selectSub None model :: + (Cmd.ofMsg (SetPnLSort <| fst model.PnLSortDirection )):: + [ for f in model.PnLFilterValues do yield Cmd.ofMsg (SetPnLFilter (f.Key, f.Value))]) | UpdateProducts data -> { model with mdRelayProductData = data}, Cmd.ofExistingPromise (requestExpNames model.mdRelay) id (box>>ErrorOccured) | ChangePnLColumnVisibility (header, visibility) ->