diff --git a/src/Views/MapView.elm b/src/Views/MapView.elm index 505371ba51b3a02a4f51814853ea7484277f29a9..c5f823d56dc1afa8248a99075e6c0589859262d2 100644 --- a/src/Views/MapView.elm +++ b/src/Views/MapView.elm @@ -145,8 +145,8 @@ update msg global model = -- Set selected consulate country. Deselect if the same country was clicked again. ConsulateCountry -> if Just country == (model.selectedConsulate |> Maybe.map Tuple.first) - then (global, { model | selectedConsulate = Nothing }, Cmd.none) -- Deselect. - else (global, { model | selectedConsulate = Just ( country, Nothing ) }, Cmd.none) -- Select. + then ( { global | selectedConsulateCountry = Nothing }, { model | selectedConsulate = Nothing }, Cmd.none) -- Deselect. + else ( { global | selectedConsulateCountry = Just country.context.meta.iso_a2 }, { model | selectedConsulate = Just ( country, Nothing ) }, Cmd.none) -- Select. -- Do nothing. _ -> (global, model, Cmd.none)