From 958c3956ea8ee57750e747d2d4cd8f1834819081 Mon Sep 17 00:00:00 2001 From: Colin Maudry Date: Wed, 18 Mar 2026 16:05:29 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20des=20probl=C3=A8mes=20de=20double?= =?UTF-8?q?=20reload=20#65?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/observatoire.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/pages/observatoire.py b/src/pages/observatoire.py index b42a99a..6887f93 100644 --- a/src/pages/observatoire.py +++ b/src/pages/observatoire.py @@ -301,19 +301,25 @@ Alors, on fait comment ? @callback( Output("dashboard_acheteur_id", "value"), Output("dashboard_titulaire_id", "value"), - Output("dashboard_url", "search"), + # Output("dashboard_url", "search"), Input("dashboard_url", "search"), ) def restore_filters_from_url(search): if not search: - return no_update, no_update, no_update + return no_update, no_update params = urllib.parse.parse_qs(search.lstrip("?")) - acheteur_id = params.get("acheteur_id", [None])[0] or no_update - titulaire_id = params.get("titulaire_id", [None])[0] or no_update + def get_param_value(key): + values = params.get(key) + if values and values[0] is not None: + return values[0] + return no_update - return acheteur_id, titulaire_id, "" + acheteur_id = get_param_value("acheteur_id") + titulaire_id = get_param_value("titulaire_id") + + return acheteur_id, titulaire_id @callback(