From 9711c6ad1e3aca76ee3fa1862a7ffaf92a0589a8 Mon Sep 17 00:00:00 2001
From: Dorine Lambinet <dorine.lambinet@assemblee-nationale.fr>
Date: Thu, 3 Oct 2024 12:24:23 +0200
Subject: [PATCH] Fix bug de la variable mockvalue et l'ajoute dans
 l'example.env

---
 example.env                                             | 3 +++
 src/lib/components/variables/InflationLawDetails.svelte | 4 ++--
 src/routes/+layout.svelte                               | 4 +---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/example.env b/example.env
index 2f1eac40f..593a054ec 100644
--- a/example.env
+++ b/example.env
@@ -86,6 +86,9 @@ PROXY=false
 # Reform name must belong to a name of an OpenFisca reform in metadata.json
 # REFORM_REVALUATION=contrefactuel_plf
 
+# Indique que la réforme PLF est fausse si cette variable est à true.
+REFORM_MOCK_VALUES=false
+
 # Show intro balloons.
 SHOW_TUTORIAL=true
 
diff --git a/src/lib/components/variables/InflationLawDetails.svelte b/src/lib/components/variables/InflationLawDetails.svelte
index bc7744877..18dcee63f 100644
--- a/src/lib/components/variables/InflationLawDetails.svelte
+++ b/src/lib/components/variables/InflationLawDetails.svelte
@@ -180,7 +180,7 @@
           >
         {/if}
       </span>
-      {#if billMockValues}
+      {#if $billMockValues}
         <!-- MONTRER WARNING -->
         <button
           class="mt-2 font-sans text-base bg-orange-200 px-1 italic text-orange-800 hover:underline cursor-pointer"
@@ -213,7 +213,7 @@
         />En {$yearPLF}, les seuils augmentent de {revaluationInflatorValueFormatted}.
       </p>
     {/if}
-    {#if billMockValues}
+    {#if $billMockValues}
       <!-- MONTRER WARNING -->
       <button
         class="mt-2 font-sans text-base bg-orange-200 px-1 italic text-orange-800 hover:underline cursor-pointer"
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 0001a7d32..63e552f47 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -105,9 +105,7 @@
   setContext("billName", billName)
   const billActive: Writable<boolean> = writable(currentBillName !== undefined)
   setContext("billActive", billActive)
-  const billMockValues: Writable<boolean> = writable(
-    data.reformMockValues === true,
-  )
+  const billMockValues: Writable<boolean> = writable(data.reformMockValues)
   setContext("billMockValues", billMockValues)
 
   let currentRevaluationName: string | undefined =
-- 
GitLab