From 6ad1594d754634a0f1891de4eb43786735017cd1 Mon Sep 17 00:00:00 2001 From: Kimo Knowles Date: Thu, 7 Dec 2023 14:44:03 +0100 Subject: [PATCH] Correctly restore falsy local-storage keys --- CHANGELOG.md | 6 ++++++ src/day8/re_frame_10x/fx/local_storage.cljs | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57e7c485..a9c9a2aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). +## 1.9.2 (2023-12-6) + +#### Fixed + +- Fixed restoration of falsy local-store values. Now states like panel open/closed are persistent again. + ## 1.9.1 (2023-12-1) #### Fixed diff --git a/src/day8/re_frame_10x/fx/local_storage.cljs b/src/day8/re_frame_10x/fx/local_storage.cljs index c058b7d2..35ba3ce6 100644 --- a/src/day8/re_frame_10x/fx/local_storage.cljs +++ b/src/day8/re_frame_10x/fx/local_storage.cljs @@ -67,6 +67,7 @@ (let [k (keyword storage-key) v (load storage-key)] (cond-> coeffects - :do (assoc k (or v fallback)) - v (assoc-in [::stored k] v) - fallback (assoc-in [::fallback k] fallback))))) + (some? fallback) (-> (assoc k fallback) + (assoc-in [::fallback k] fallback)) + (some? v) (-> (assoc k v) + (assoc-in [::stored k] v))))))