From ba67df51e04b32e84ae76d096a1ed820634d32a0 Mon Sep 17 00:00:00 2001
From: Damian Romano Haj-Houssin <damian.haj-houssin@student.uni-halle.de>
Date: Sat, 4 Jan 2025 22:22:43 +0100
Subject: [PATCH] Modified MapView to set global consulate country on click
 (though a change of the global variable does currently not change the local
 view).

---
 src/Views/MapView.elm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Views/MapView.elm b/src/Views/MapView.elm
index 505371b..c5f823d 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)
 
-- 
GitLab