2022-11-14 18:16:55 +00:00
|
|
|
(ns status-im2.subs.bootnodes
|
2022-09-21 14:03:06 +00:00
|
|
|
(:require [re-frame.core :as re-frame]))
|
|
|
|
|
|
|
|
(re-frame/reg-sub
|
|
|
|
:custom-bootnodes/enabled?
|
|
|
|
:<- [:multiaccount]
|
|
|
|
:<- [:networks/current-network]
|
|
|
|
(fn [[{:keys [custom-bootnodes-enabled?]} current-network]]
|
|
|
|
(get custom-bootnodes-enabled? current-network)))
|
|
|
|
|
|
|
|
(re-frame/reg-sub
|
|
|
|
:custom-bootnodes/network-bootnodes
|
|
|
|
:<- [:multiaccount]
|
|
|
|
:<- [:networks/current-network]
|
|
|
|
(fn [[multiaccount current-network]]
|
|
|
|
(get-in multiaccount [:custom-bootnodes current-network])))
|
|
|
|
|
|
|
|
(re-frame/reg-sub
|
|
|
|
:get-manage-bootnode
|
|
|
|
:<- [:bootnodes/manage]
|
|
|
|
(fn [manage]
|
|
|
|
manage))
|
|
|
|
|
|
|
|
(re-frame/reg-sub
|
|
|
|
:wakuv2-nodes/validation-errors
|
|
|
|
:<- [:wakuv2-nodes/manage]
|
|
|
|
(fn [manage]
|
|
|
|
(set (keep
|
|
|
|
(fn [[k {:keys [error]}]]
|
|
|
|
(when error k))
|
|
|
|
manage))))
|