Skip to content

Commit

Permalink
Fix re-frame warning about fx being nil (#20175)
Browse files Browse the repository at this point in the history
Fixes a warning thrown by re-frame in the event
:wallet/blockchain-status-changed.

Here's a simplified example that generates the same warning.

```clojure
(rf/reg-event-fx :user/fx-warning
 (fn []
   {:fx nil}))

;; Prints warning re-frame: ":fx" effect expects a seq, but was given null
(rf/dispatch [:user/fx-warning])
```
  • Loading branch information
ilmotta authored May 27, 2024
1 parent 2fc5bed commit 3d1c0c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/status_im/constants.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@

(def ^:const community-id-length 68)

(def ^:const toast-chain-down-duration 5000)

; BIP44 Wallet Root Key, the extended key from which any wallet can be derived
(def ^:const path-wallet-root "m/44'/60'/0'/0")
; EIP1581 Root Key, the extended key from which any whisper key/encryption key can be derived
Expand Down
6 changes: 3 additions & 3 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,13 @@
(log/info "[wallet] Test network enabled: " (boolean test-networks-enabled?))
(log/info "[wallet] Goerli network enabled: " (boolean is-goerli-enabled?)))
{:db (assoc-in db [:wallet :statuses :blockchains] chains)
:fx (when chains-down?
[[:dispatch
:fx [(when chains-down?
[:dispatch
[:toasts/upsert
{:id :chains-down
:type :negative
:text (i18n/label :t/provider-is-down {:chains chain-names})
:duration 10000}]]])})))
:duration constants/toast-chain-down-duration}]])]})))

(defn reset-selected-networks
[{:keys [db]}]
Expand Down

0 comments on commit 3d1c0c6

Please sign in to comment.