Skip to content

Commit

Permalink
Correctly restore falsy local-storage keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kimo-k committed Dec 7, 2023
1 parent 73a2750 commit 6ad1594
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions src/day8/re_frame_10x/fx/local_storage.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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))))))

0 comments on commit 6ad1594

Please sign in to comment.