mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-13 18:25:45 +00:00
fixed, get would fail when key doesn't exist
Former-commit-id: 83ab6ad3ef9028a95e793e7a01aa9f21af59e961
This commit is contained in:
parent
85f7a08380
commit
b27e47a91f
@ -55,7 +55,7 @@
|
|||||||
(-> (aget result 0)))
|
(-> (aget result 0)))
|
||||||
|
|
||||||
(defn single-cljs [result]
|
(defn single-cljs [result]
|
||||||
(-> (aget result 0)
|
(some-> (aget result 0)
|
||||||
(js->clj :keywordize-keys true)))
|
(js->clj :keywordize-keys true)))
|
||||||
|
|
||||||
(defn decode-value [{:keys [key value]}]
|
(defn decode-value [{:keys [key value]}]
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
(r/create :kv-store {:key key
|
(r/create :kv-store {:key key
|
||||||
:value (str value)} true))))
|
:value (str value)} true))))
|
||||||
(get [_ key]
|
(get [_ key]
|
||||||
(-> (r/get-by-field :kv-store :key key)
|
(some-> (r/get-by-field :kv-store :key key)
|
||||||
(r/single-cljs)
|
(r/single-cljs)
|
||||||
(r/decode-value)))
|
(r/decode-value)))
|
||||||
(contains-key? [_ key]
|
(contains-key? [_ key]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user