Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8408b4fff |
@@ -40,23 +40,6 @@
|
||||
config
|
||||
#(callback (types/json->clj %))))
|
||||
|
||||
(defn save-account-and-login
|
||||
"NOTE: beware, the password has to be sha3 hashed"
|
||||
[key-uid multiaccount-data hashed-password settings config accounts-data]
|
||||
(log/debug "[native-module] save-account-and-login"
|
||||
"multiaccount-data"
|
||||
multiaccount-data)
|
||||
(clear-web-data)
|
||||
(init-keystore
|
||||
key-uid
|
||||
#(.saveAccountAndLogin
|
||||
^js (status)
|
||||
multiaccount-data
|
||||
hashed-password
|
||||
settings
|
||||
config
|
||||
accounts-data)))
|
||||
|
||||
(defn save-multiaccount-and-login-with-keycard
|
||||
"NOTE: chat-key is a whisper private key sent from keycard"
|
||||
[key-uid multiaccount-data password settings config accounts-data chat-key]
|
||||
|
||||
@@ -118,61 +118,13 @@
|
||||
"M2.79504 9.01494C2.89473 8.85584 3.00297 8.70977 3.11963 8.5761C3.90594 7.67512 4.97212 7.45024 5.99992 7.45024C7.02772 7.45024 8.0939 7.67512 8.88021 8.5761C8.99688 8.70978 9.10512 8.85585 9.2048 9.01495C8.9501 9.28561 8.66149 9.52401 8.34577 9.72335C8.25403 9.55824 8.15512 9.41818 8.05145 9.29939C7.56503 8.74204 6.88121 8.55024 5.99992 8.55024C5.11862 8.55024 4.43481 8.74204 3.94839 9.29939C3.84472 9.41818 3.74582 9.55824 3.65408 9.72334C3.33835 9.524 3.04975 9.2856 2.79504 9.01494ZM5.99992 3.5502C5.47525 3.5502 5.04992 3.97552 5.04992 4.5002C5.04992 5.02487 5.47525 5.4502 5.99992 5.4502C6.52459 5.4502 6.94992 5.02487 6.94992 4.5002C6.94992 3.97552 6.52459 3.5502 5.99992 3.5502ZM3.94992 4.5002C3.94992 3.36801 4.86773 2.4502 5.99992 2.4502C7.1321 2.4502 8.04992 3.36801 8.04992 4.5002C8.04992 5.63238 7.1321 6.5502 5.99992 6.5502C4.86773 6.5502 3.94992 5.63238 3.94992 4.5002Z"
|
||||
:fill color-2}]])
|
||||
|
||||
(defn- contact-20
|
||||
[{:keys [color color-2]
|
||||
:or {color colors/neutral-100
|
||||
color-2 colors/white}
|
||||
:as props}]
|
||||
[container props
|
||||
[svg/circle
|
||||
{:cx 10
|
||||
:cy 10
|
||||
:r 7.5
|
||||
:fill color}]
|
||||
[svg/path
|
||||
{:d
|
||||
"M8.65002 7.99998C8.65002 7.25439 9.25443 6.64998 10 6.64998C10.7456 6.64998 11.35 7.25439 11.35 7.99998C11.35 8.74556 10.7456 9.34998 10 9.34998C9.25443 9.34998 8.65002 8.74556 8.65002 7.99998ZM10 5.34998C8.53646 5.34998 7.35002 6.53642 7.35002 7.99998C7.35002 9.46353 8.53646 10.65 10 10.65C11.4636 10.65 12.65 9.46353 12.65 7.99998C12.65 6.53642 11.4636 5.34998 10 5.34998ZM10 13.65C8.67557 13.65 7.53064 14.4186 6.98692 15.5341C6.60094 15.3235 6.23942 15.0737 5.90771 14.79C6.69408 13.3369 8.23179 12.35 10 12.35C11.7682 12.35 13.306 13.3369 14.0923 14.79C13.7606 15.0737 13.3991 15.3235 13.0131 15.5341C12.4694 14.4186 11.3245 13.65 10 13.65Z"
|
||||
:fill color-2}]])
|
||||
|
||||
(defn- verified-20
|
||||
[{:keys [color color-2]
|
||||
:or {color colors/neutral-100
|
||||
color-2 colors/white}
|
||||
:as props}]
|
||||
[container props
|
||||
[svg/path
|
||||
{:d
|
||||
"M18 10C18 8.77003 17.1118 7.74751 15.9418 7.53891C16.6216 6.56407 16.5267 5.21294 15.6569 4.34321C14.7872 3.47344 13.436 3.37852 12.4611 4.05845C12.2526 2.88834 11.23 2 10 2C8.77 2 7.74747 2.88827 7.53889 4.05832C6.56406 3.37846 5.21292 3.47339 4.34318 4.34313C3.47343 5.21288 3.3785 6.56404 4.05839 7.53888C2.88831 7.74743 2 8.76998 2 10C2 11.23 2.88824 12.2525 4.05826 12.4611C3.3784 13.4359 3.47333 14.7871 4.34307 15.6568C5.21284 16.5266 6.56403 16.6215 7.53887 15.9416C7.74741 17.1117 8.76996 18 10 18C11.23 18 12.2525 17.1117 12.4611 15.9417C13.4359 16.6215 14.7871 16.5266 15.6568 15.6569C16.5265 14.7871 16.6215 13.436 15.9416 12.4611C17.1117 12.2526 18 11.23 18 10Z"
|
||||
:fill color}]
|
||||
[svg/path
|
||||
{:d "M7.25 10.75L9.25 12.25L12.75 7.75"
|
||||
:stroke color-2
|
||||
:stroke-width "1.2"}]])
|
||||
|
||||
(defn- untrustworthy-20
|
||||
[{:keys [color color-2]
|
||||
:or {color colors/neutral-100
|
||||
color-2 colors/white}
|
||||
:as props}]
|
||||
[container props
|
||||
[svg/path
|
||||
{:d "M10 2L15.6569 4.34315L18 10L15.6569 15.6569L10 18L4.34315 15.6569L2 10L4.34315 4.34315L10 2Z"
|
||||
:fill color}]
|
||||
[svg/path
|
||||
{:d
|
||||
"M10.75 5.5L10.55 11.5H9.45L9.25 5.5H10.75ZM10 13C10.4142 13 10.75 13.3358 10.75 13.75C10.75 14.1642 10.4142 14.5 10 14.5C9.58579 14.5 9.25 14.1642 9.25 13.75C9.25 13.3358 9.58579 13 10 13Z"
|
||||
:fill color-2}]])
|
||||
|
||||
(def ^:private icons
|
||||
{:i/clear-20 clear-20
|
||||
:i/dropdown-20 dropdown-20
|
||||
:i/pullup-20 pullup-20
|
||||
:i/dropdown-12 dropdown-12
|
||||
:i/pullup-12 pullup-12
|
||||
:i/contact-12 contact-12
|
||||
:i/contact-20 contact-20
|
||||
:i/verified-20 verified-20
|
||||
:i/untrustworthy-20 untrustworthy-20})
|
||||
{:i/clear-20 clear-20
|
||||
:i/dropdown-20 dropdown-20
|
||||
:i/pullup-20 pullup-20
|
||||
:i/dropdown-12 dropdown-12
|
||||
:i/pullup-12 pullup-12
|
||||
:i/contact-12 contact-12})
|
||||
|
||||
(defn- append-to-keyword
|
||||
[k & xs]
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
(ns quo.components.text-combinations.username.component-spec
|
||||
(:require [quo.components.text-combinations.username.view :as username]
|
||||
[test-helpers.component :as h]))
|
||||
|
||||
(defn test-all-status
|
||||
[component-to-render component-props]
|
||||
(h/test "Verified status"
|
||||
(h/render [component-to-render (assoc component-props :status :verified)])
|
||||
(h/is-truthy (h/get-by-label-text :username-status-icon)))
|
||||
|
||||
(h/test "Contact status"
|
||||
(h/render [component-to-render (assoc component-props :status :contact)])
|
||||
(h/is-truthy (h/get-by-label-text :username-status-icon)))
|
||||
|
||||
(h/test "Untrustworthy status"
|
||||
(h/render [component-to-render (assoc component-props :status :untrustworthy)])
|
||||
(h/is-truthy (h/get-by-label-text :username-status-icon)))
|
||||
|
||||
(h/test "Untrustworthy contact status"
|
||||
(h/render [component-to-render (assoc component-props :status :untrustworthy-contact)])
|
||||
(let [icons (h/get-all-by-label-text :username-status-icon)]
|
||||
(h/is-truthy (aget icons 0))
|
||||
(h/is-truthy (aget icons 1))))
|
||||
|
||||
(h/test "Blocked status"
|
||||
(h/render [component-to-render (assoc component-props :status :blocked)])
|
||||
(h/is-truthy (h/get-by-label-text :username-status-icon))))
|
||||
|
||||
(h/describe "Text combinations - Username"
|
||||
(h/test "Renders default"
|
||||
(h/render [username/view {:username "Test username"}])
|
||||
(h/is-truthy (h/get-by-text "Test username")))
|
||||
|
||||
(h/describe "Render different :name-type values"
|
||||
(h/describe "default"
|
||||
(let [props {:name-type :default
|
||||
:username "Test username"}]
|
||||
|
||||
(h/test "default render"
|
||||
(h/render [username/view props])
|
||||
(h/is-truthy (h/get-by-text "Test username")))
|
||||
|
||||
(h/describe "All status are rendered"
|
||||
(test-all-status username/view props))))
|
||||
|
||||
(h/describe "ens"
|
||||
(let [props {:name-type :ens
|
||||
:username "test-username.eth"}]
|
||||
|
||||
(h/test "no status render"
|
||||
(h/render [username/view props])
|
||||
(h/is-truthy (h/get-by-text "test-username.eth")))
|
||||
|
||||
(h/describe "All status are rendered"
|
||||
(test-all-status username/view props))))
|
||||
|
||||
(h/describe "nickname"
|
||||
(let [props {:name-type :nickname
|
||||
:username "Nickname"
|
||||
:name "Real name"}]
|
||||
|
||||
(h/test "no status render"
|
||||
(h/render [username/view props])
|
||||
(h/is-truthy (h/get-by-text "Nickname"))
|
||||
(h/is-truthy (h/get-by-text "Real name")))
|
||||
|
||||
(h/describe "All status are rendered"
|
||||
(test-all-status username/view props))))))
|
||||
@@ -1,30 +0,0 @@
|
||||
(ns quo.components.text-combinations.username.style
|
||||
(:require [quo.foundations.colors :as colors]))
|
||||
|
||||
(def container
|
||||
{:flex-direction :row
|
||||
:height 32})
|
||||
|
||||
(def username-text-container
|
||||
{:flex-direction :row
|
||||
:align-items :flex-end})
|
||||
|
||||
(defn real-name-text
|
||||
[theme blur?]
|
||||
{:color (if blur?
|
||||
(colors/theme-colors colors/neutral-80-opa-40 colors/white-opa-40 theme)
|
||||
(colors/theme-colors colors/neutral-60 colors/neutral-40 theme))})
|
||||
|
||||
(defn real-name-dot
|
||||
[theme blur?]
|
||||
(assoc (real-name-text theme blur?) :margin-horizontal 6))
|
||||
|
||||
(defn status-icon-container
|
||||
[name-type status]
|
||||
(cond-> {:flex-direction :row
|
||||
:margin-left 4}
|
||||
(#{:default :ens} name-type) (assoc :margin-top 8
|
||||
:margin-bottom 4)
|
||||
(= :nickname name-type) (assoc :margin-top 10
|
||||
:margin-bottom 2)
|
||||
(= status :untrustworthy-contact) (assoc :margin-right 2)))
|
||||
@@ -1,57 +0,0 @@
|
||||
(ns quo.components.text-combinations.username.view
|
||||
(:require [quo.components.icon :as icon]
|
||||
[quo.components.markdown.text :as text]
|
||||
[quo.components.text-combinations.username.style :as style]
|
||||
[quo.foundations.colors :as colors]
|
||||
[quo.theme]
|
||||
[react-native.core :as rn]))
|
||||
|
||||
(defn- username-text
|
||||
[{:keys [theme name-type username blur?]
|
||||
real-name :name}]
|
||||
[rn/view {:style style/username-text-container}
|
||||
[text/text
|
||||
{:size :heading-1
|
||||
:weight :semi-bold}
|
||||
username]
|
||||
(when (= name-type :nickname)
|
||||
[:<>
|
||||
[text/text
|
||||
{:style (style/real-name-dot theme blur?)
|
||||
:size :paragraph-1
|
||||
:weight :medium}
|
||||
"∙"]
|
||||
[text/text
|
||||
{:style (style/real-name-text theme blur?)
|
||||
:size :paragraph-1
|
||||
:weight :medium}
|
||||
real-name]])])
|
||||
|
||||
(defn- icon-20
|
||||
[icon-name theme color]
|
||||
[icon/icon icon-name
|
||||
{:accessibility-label :username-status-icon
|
||||
:size 20
|
||||
:color (colors/resolve-color color theme)}])
|
||||
|
||||
(defn status-icon
|
||||
[{:keys [theme name-type status]
|
||||
:or {name-type :default}}]
|
||||
[rn/view {:style (style/status-icon-container name-type status)}
|
||||
(case status
|
||||
:verified [icon-20 :i/verified theme :success]
|
||||
:contact [icon-20 :i/contact theme :blue]
|
||||
:untrustworthy [icon-20 :i/untrustworthy theme :danger]
|
||||
:blocked [icon-20 :i/block theme :danger]
|
||||
:untrustworthy-contact [:<>
|
||||
[icon-20 :i/untrustworthy theme :danger]
|
||||
[icon-20 :i/contact theme :blue]]
|
||||
nil)])
|
||||
|
||||
(defn view-internal
|
||||
[props]
|
||||
[rn/view {:style style/container}
|
||||
[username-text props]
|
||||
[status-icon props]])
|
||||
|
||||
(def view (quo.theme/with-theme view-internal))
|
||||
@@ -141,7 +141,6 @@
|
||||
quo.components.tags.token-tag.view
|
||||
quo.components.text-combinations.channel-name.view
|
||||
quo.components.text-combinations.standard-title.view
|
||||
quo.components.text-combinations.username.view
|
||||
quo.components.text-combinations.view
|
||||
quo.components.wallet.account-card.view
|
||||
quo.components.wallet.account-origin.view
|
||||
@@ -386,7 +385,6 @@
|
||||
(def channel-name quo.components.text-combinations.channel-name.view/view)
|
||||
(def standard-title quo.components.text-combinations.standard-title.view/view)
|
||||
(def text-combinations quo.components.text-combinations.view/view)
|
||||
(def username quo.components.text-combinations.username.view/view)
|
||||
|
||||
;;;; Wallet
|
||||
(def account-card quo.components.wallet.account-card.view/view)
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
[quo.components.tags.summary-tag.component-spec]
|
||||
[quo.components.tags.tiny-tag.component-spec]
|
||||
[quo.components.text-combinations.channel-name.component-spec]
|
||||
[quo.components.text-combinations.username.component-spec]
|
||||
[quo.components.wallet.account-card.component-spec]
|
||||
[quo.components.wallet.account-origin.component-spec]
|
||||
[quo.components.wallet.account-overview.component-spec]
|
||||
|
||||
@@ -285,6 +285,10 @@
|
||||
(get-in colors-map [color suffix]))))
|
||||
|
||||
(defn- resolve-color*
|
||||
"(resolve-color color theme opacity)
|
||||
color hex string or keyword (resolves from custom, network and semantic colors)
|
||||
theme :light/:dark
|
||||
opacity 0-100 (optional) - if set theme is ignored and goes to 50 suffix internally"
|
||||
([color theme]
|
||||
(resolve-color* color theme nil))
|
||||
([color theme opacity]
|
||||
@@ -296,12 +300,7 @@
|
||||
suffix (get-from-colors-map suffix)
|
||||
opacity (alpha (/ opacity 100))))))
|
||||
|
||||
(def resolve-color
|
||||
"(resolve-color color theme opacity)
|
||||
color hex string or keyword (resolves from custom, network and semantic colors)
|
||||
theme :light/:dark
|
||||
opacity 0-100 (optional) - if set theme is ignored and goes to 50 suffix internally"
|
||||
(memoize resolve-color*))
|
||||
(def resolve-color (memoize resolve-color*))
|
||||
|
||||
(def ^{:deprecated true :superseded-by "resolve-color"}
|
||||
custom-color
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.node.core :as node]
|
||||
[status-im2.config :as config]
|
||||
[status-im2.constants :as constants]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
@@ -78,10 +77,9 @@
|
||||
[{:keys [db now] :as cofx} fleet]
|
||||
(let [old-fleet (get-in db [:profile/profile :fleet])]
|
||||
(when (not= fleet old-fleet)
|
||||
(rf/merge
|
||||
(multiaccounts.update/multiaccount-update
|
||||
cofx
|
||||
(multiaccounts.update/multiaccount-update :fleet fleet {})
|
||||
(node/prepare-new-config
|
||||
{:on-success
|
||||
#(re-frame/dispatch
|
||||
[:multiaccounts.update.callback/save-settings-success])})))))
|
||||
:fleet
|
||||
fleet
|
||||
{:on-success
|
||||
#(re-frame/dispatch [:logout])}))))
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
[taoensso.timbre :as log]
|
||||
[utils.address :as address]
|
||||
[utils.datetime :as datetime]
|
||||
[utils.ethereum.eip.eip55 :as eip55]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.security.core :as security]))
|
||||
@@ -182,26 +181,28 @@
|
||||
{:db (-> db
|
||||
(assoc-in [:keycard :setup-step] nil)
|
||||
(dissoc :intro-wizard))}
|
||||
(multiaccounts.create/on-multiaccount-created
|
||||
{:recovered (or recovered (get-in db [:intro-wizard :recovering?]))
|
||||
:derived {constants/path-wallet-root-keyword
|
||||
{:public-key wallet-root-public-key
|
||||
:address (eip55/address->checksum wallet-root-address)}
|
||||
constants/path-whisper-keyword
|
||||
{:public-key whisper-public-key
|
||||
:address (eip55/address->checksum whisper-address)}
|
||||
constants/path-default-wallet-keyword
|
||||
{:public-key wallet-public-key
|
||||
:address (eip55/address->checksum wallet-address)}}
|
||||
:address address
|
||||
:public-key public-key
|
||||
:keycard-instance-uid instance-uid
|
||||
:key-uid (address/normalized-hex key-uid)
|
||||
:keycard-pairing pairing
|
||||
:keycard-paired-on paired-on
|
||||
:chat-key whisper-private-key}
|
||||
encryption-public-key
|
||||
{}))))
|
||||
;; NOTE: Disabling as keycard not functional and this needs to be moved to
|
||||
;; status-go
|
||||
#_(multiaccounts.create/on-multiaccount-created
|
||||
{:recovered (or recovered (get-in db [:intro-wizard :recovering?]))
|
||||
:derived {constants/path-wallet-root-keyword
|
||||
{:public-key wallet-root-public-key
|
||||
:address (eip55/address->checksum wallet-root-address)}
|
||||
constants/path-whisper-keyword
|
||||
{:public-key whisper-public-key
|
||||
:address (eip55/address->checksum whisper-address)}
|
||||
constants/path-default-wallet-keyword
|
||||
{:public-key wallet-public-key
|
||||
:address (eip55/address->checksum wallet-address)}}
|
||||
:address address
|
||||
:public-key public-key
|
||||
:keycard-instance-uid instance-uid
|
||||
:key-uid (address/normalized-hex key-uid)
|
||||
:keycard-pairing pairing
|
||||
:keycard-paired-on paired-on
|
||||
:chat-key whisper-private-key}
|
||||
encryption-public-key
|
||||
{}))))
|
||||
|
||||
(rf/defn return-to-keycard-login
|
||||
[{:keys [db] :as cofx}]
|
||||
|
||||
@@ -489,14 +489,15 @@
|
||||
(log/warn "sign-typed-data not implemented" args))
|
||||
|
||||
(defn save-multiaccount-and-login
|
||||
[{:keys [key-uid multiaccount-data password settings node-config accounts-data]}]
|
||||
(native-module/save-account-and-login
|
||||
key-uid
|
||||
(types/clj->json multiaccount-data)
|
||||
password
|
||||
(types/clj->json settings)
|
||||
node-config
|
||||
(types/clj->json accounts-data)))
|
||||
[_]
|
||||
;; NOTE: disabling as we don't support keycard for now and it's using an outdated endpoint
|
||||
#_(native-module/save-account-and-login
|
||||
key-uid
|
||||
(types/clj->json multiaccount-data)
|
||||
password
|
||||
(types/clj->json settings)
|
||||
node-config
|
||||
(types/clj->json accounts-data)))
|
||||
|
||||
(defn login
|
||||
[{:keys [key-uid multiaccount-data password]}]
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
(:require
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.node.core :as node]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
@@ -11,13 +10,11 @@
|
||||
[{:keys [db now] :as cofx} log-level]
|
||||
(let [old-log-level (get-in db [:profile/profile :log-level])]
|
||||
(when (not= old-log-level log-level)
|
||||
(rf/merge cofx
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:log-level
|
||||
log-level
|
||||
{})
|
||||
(node/prepare-new-config
|
||||
{:on-success #(re-frame/dispatch [:logout])})))))
|
||||
(multiaccounts.update/multiaccount-update
|
||||
cofx
|
||||
:log-level
|
||||
log-level
|
||||
{:on-success #(re-frame/dispatch [:logout])}))))
|
||||
|
||||
(rf/defn show-change-log-level-confirmation
|
||||
{:events [:log-level.ui/log-level-selected]}
|
||||
|
||||
@@ -2,17 +2,10 @@
|
||||
(:require
|
||||
[native-module.core :as native-module]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.data-store.settings :as data-store.settings]
|
||||
[status-im.node.core :as node]
|
||||
[status-im.ui.components.colors :as colors]
|
||||
[status-im.utils.deprecated-types :as types]
|
||||
[status-im.utils.signing-phrase.core :as signing-phrase]
|
||||
[status-im2.config :as config]
|
||||
[status-im2.constants :as constants]
|
||||
[utils.ethereum.eip.eip55 :as eip55]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]
|
||||
[utils.security.core :as security]))
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn normalize-derived-data-keys
|
||||
[derived-data]
|
||||
@@ -82,134 +75,3 @@
|
||||
(rf/defn save-multiaccount-and-login-with-keycard
|
||||
[_ args]
|
||||
{:keycard/save-multiaccount-and-login args})
|
||||
|
||||
(re-frame/reg-fx
|
||||
::save-account-and-login
|
||||
(fn [[key-uid multiaccount-data hashed-password settings config accounts-data]]
|
||||
(native-module/save-account-and-login
|
||||
key-uid
|
||||
multiaccount-data
|
||||
hashed-password
|
||||
settings
|
||||
config
|
||||
accounts-data)))
|
||||
|
||||
(rf/defn save-account-and-login
|
||||
[_ key-uid multiaccount-data password settings node-config accounts-data]
|
||||
{::save-account-and-login [key-uid
|
||||
(types/clj->json multiaccount-data)
|
||||
password
|
||||
(types/clj->json settings)
|
||||
node-config
|
||||
(types/clj->json accounts-data)]})
|
||||
|
||||
(defn prepare-accounts-data
|
||||
[multiaccount]
|
||||
[(let [{:keys [public-key address]}
|
||||
(get-in multiaccount [:derived constants/path-default-wallet-keyword])]
|
||||
{:public-key public-key
|
||||
:address (eip55/address->checksum address)
|
||||
:color colors/blue-persist
|
||||
:wallet true
|
||||
:path constants/path-default-wallet
|
||||
:name (i18n/label :t/main-account)})
|
||||
(let [{:keys [compressed-key public-key address name]}
|
||||
(get-in multiaccount [:derived constants/path-whisper-keyword])]
|
||||
{:public-key public-key
|
||||
:compressed-key compressed-key
|
||||
:address (eip55/address->checksum address)
|
||||
:name name
|
||||
:path constants/path-whisper
|
||||
:chat true})])
|
||||
|
||||
(rf/defn on-multiaccount-created
|
||||
[{:keys [signing-phrase random-guid-generator db] :as cofx}
|
||||
{:keys [address chat-key keycard-instance-uid key-uid
|
||||
keycard-pairing keycard-paired-on mnemonic recovered]
|
||||
:as multiaccount}
|
||||
password
|
||||
{:keys [save-mnemonic? login?] :or {login? true save-mnemonic? false}}]
|
||||
(let [[wallet-account
|
||||
{:keys [public-key
|
||||
compressed-key
|
||||
name]} :as accounts-data]
|
||||
(prepare-accounts-data
|
||||
multiaccount)
|
||||
multiaccount-data {:name name
|
||||
:address address
|
||||
:key-uid key-uid
|
||||
:keycard-pairing keycard-pairing}
|
||||
keycard-multiaccount? (boolean keycard-pairing)
|
||||
eip1581-address (get-in multiaccount
|
||||
[:derived
|
||||
constants/path-eip1581-keyword
|
||||
:address])
|
||||
new-multiaccount
|
||||
(cond->
|
||||
(merge
|
||||
{;; address of the master key
|
||||
:address address
|
||||
;; sha256 of master public key
|
||||
:key-uid key-uid
|
||||
;; The address from which we derive any wallet
|
||||
:wallet-root-address
|
||||
(get-in multiaccount
|
||||
[:derived
|
||||
constants/path-wallet-root-keyword
|
||||
:address])
|
||||
:name name
|
||||
;; public key of the chat account
|
||||
:public-key public-key
|
||||
;; compressed key of the chat account
|
||||
:compressed-key compressed-key
|
||||
;; default address for Dapps
|
||||
:dapps-address (:address wallet-account)
|
||||
:latest-derived-path 0
|
||||
:signing-phrase signing-phrase
|
||||
:backup-enabled? true
|
||||
:installation-id (random-guid-generator)
|
||||
;; default mailserver (history node) setting
|
||||
:use-mailservers? true
|
||||
:recovered recovered}
|
||||
config/default-multiaccount)
|
||||
;; The address from which we derive any chat
|
||||
;; account/encryption keys
|
||||
eip1581-address
|
||||
(assoc :eip1581-address eip1581-address)
|
||||
save-mnemonic?
|
||||
(assoc :mnemonic mnemonic)
|
||||
keycard-multiaccount?
|
||||
(assoc :keycard-instance-uid keycard-instance-uid
|
||||
:keycard-pairing keycard-pairing
|
||||
:keycard-paired-on keycard-paired-on))
|
||||
db (assoc db
|
||||
:profile/login {:key-uid key-uid
|
||||
:name name
|
||||
:password password
|
||||
:creating? true
|
||||
:processing true}
|
||||
:profile/profile new-multiaccount
|
||||
:profile/wallet-accounts [wallet-account]
|
||||
:networks/current-network config/default-network
|
||||
:networks/networks (data-store.settings/rpc->networks config/default-networks))
|
||||
settings (assoc new-multiaccount
|
||||
:networks/current-network config/default-network
|
||||
:networks/networks config/default-networks)]
|
||||
(rf/merge cofx
|
||||
{:db db}
|
||||
(if keycard-multiaccount?
|
||||
(save-multiaccount-and-login-with-keycard
|
||||
{:key-uid key-uid
|
||||
:multiaccount-data multiaccount-data
|
||||
:password password
|
||||
:settings settings
|
||||
:node-config (node/get-new-config db)
|
||||
:accounts-data accounts-data
|
||||
:chat-key chat-key})
|
||||
(save-account-and-login
|
||||
key-uid
|
||||
multiaccount-data
|
||||
(native-module/sha3 (security/safe-unmask-data password))
|
||||
settings
|
||||
(node/get-new-config db)
|
||||
accounts-data)))))
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.node.core :as node]
|
||||
[status-im2.navigation.events :as navigation]
|
||||
[utils.ethereum.chain :as chain]
|
||||
[utils.i18n :as i18n]
|
||||
@@ -117,12 +116,10 @@
|
||||
(rf/defn save-network-settings
|
||||
{:events [::save-network-settings-pressed]}
|
||||
[{:keys [db] :as cofx} network]
|
||||
(rf/merge cofx
|
||||
{:db (assoc db :networks/current-network network)
|
||||
:json-rpc/call [{:method "settings_saveSetting"
|
||||
:params [:networks/current-network network]
|
||||
:on-success #()}]}
|
||||
(node/prepare-new-config {:on-success #(re-frame/dispatch [:logout])})))
|
||||
{:db (assoc db :networks/current-network network)
|
||||
:json-rpc/call [{:method "settings_saveSetting"
|
||||
:params [:networks/current-network network]
|
||||
:on-success #(re-frame/dispatch [:logout])}]})
|
||||
|
||||
(rf/defn remove-network
|
||||
{:events [::remove-network-confirmed]}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
(ns status-im.node.core
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[native-module.core :as native-module]
|
||||
[re-frame.core :as re-frame]
|
||||
[react-native.platform :as platform]
|
||||
[status-im.utils.deprecated-types :as types]
|
||||
[status-im2.config :as config]
|
||||
[utils.re-frame :as rf]))
|
||||
[status-im2.config :as config]))
|
||||
|
||||
(defn- add-custom-bootnodes
|
||||
[config network all-bootnodes]
|
||||
@@ -196,32 +193,4 @@
|
||||
:always
|
||||
(add-log-level log-level))))
|
||||
|
||||
(defn get-new-config
|
||||
[db]
|
||||
(types/clj->json (get-multiaccount-node-config db)))
|
||||
|
||||
(rf/defn save-new-config
|
||||
"Saves a new status-go config for the current account
|
||||
This RPC method is the only way to change the node config of an account.
|
||||
NOTE: it is better used indirectly through `prepare-new-config`,
|
||||
which will take care of building up the proper config based on settings in
|
||||
app-db"
|
||||
{:events [::save-new-config]}
|
||||
[_ config {:keys [on-success]}]
|
||||
{:json-rpc/call [{:method "settings_saveSetting"
|
||||
:params [:node-config config]
|
||||
:on-success on-success}]})
|
||||
|
||||
(rf/defn prepare-new-config
|
||||
"Use this function to apply settings to the current account node config"
|
||||
[{:keys [db]} {:keys [on-success]}]
|
||||
(let [key-uid (get-in db [:profile/profile :key-uid])]
|
||||
{::prepare-new-config [key-uid
|
||||
(get-new-config db)
|
||||
#(re-frame/dispatch
|
||||
[::save-new-config % {:on-success on-success}])]}))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::prepare-new-config
|
||||
(fn [[key-uid config callback]]
|
||||
(native-module/prepare-dir-and-update-config key-uid config callback)))
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
(defn- normal-mode-settings-data
|
||||
[{:keys [network-name
|
||||
current-log-level
|
||||
waku-bloom-filter-mode
|
||||
light-client-enabled?
|
||||
transactions-management-enabled?
|
||||
wakuv2-flag
|
||||
current-fleet
|
||||
webview-debug]}]
|
||||
(keep
|
||||
@@ -54,19 +53,12 @@
|
||||
:accessory :text
|
||||
:accessory-text current-fleet
|
||||
:chevron true}
|
||||
(if wakuv2-flag
|
||||
{:size :small
|
||||
:title (i18n/label :t/wakuv2-settings)
|
||||
:accessibility-label :wakuv2-settings-button
|
||||
:on-press
|
||||
#(re-frame/dispatch [:wakuv2.ui/enter-settings-pressed])
|
||||
:chevron true}
|
||||
{:size :small
|
||||
:title (i18n/label :t/bootnodes)
|
||||
:accessibility-label :bootnodes-settings-button
|
||||
:on-press
|
||||
#(re-frame/dispatch [:navigate-to :bootnodes-settings])
|
||||
:chevron true})
|
||||
{:size :small
|
||||
:title (i18n/label :t/wakuv2-settings)
|
||||
:accessibility-label :wakuv2-settings-button
|
||||
:on-press
|
||||
#(re-frame/dispatch [:wakuv2.ui/enter-settings-pressed])
|
||||
:chevron true}
|
||||
{:size :small
|
||||
:title (i18n/label :t/rpc-usage-info)
|
||||
:accessibility-label :rpc-usage-info
|
||||
@@ -81,6 +73,15 @@
|
||||
:on-press
|
||||
#(re-frame/dispatch [:navigate-to :peers-stats])
|
||||
:chevron true}
|
||||
{:size :small
|
||||
:title (i18n/label :t/light-client-enabled)
|
||||
:accessibility-label :light-client-enabled
|
||||
:container-margin-bottom 8
|
||||
:on-press
|
||||
#(re-frame/dispatch
|
||||
[:wakuv2.ui/toggle-light-client (not light-client-enabled?)])
|
||||
:accessory :switch
|
||||
:active light-client-enabled?}
|
||||
{:size :small
|
||||
:title (i18n/label :t/transactions-management-enabled)
|
||||
:accessibility-label :transactions-management-enabled
|
||||
@@ -99,22 +100,7 @@
|
||||
#(re-frame/dispatch
|
||||
[:profile.settings/change-webview-debug (not webview-debug)])
|
||||
:accessory :switch
|
||||
:active webview-debug}
|
||||
{:size :small
|
||||
:title (i18n/label :t/waku-bloom-filter-mode)
|
||||
:accessibility-label :waku-bloom-filter-mode-settings-switch
|
||||
:container-margin-bottom 8
|
||||
:on-press
|
||||
#(re-frame/dispatch
|
||||
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
|
||||
:accessory :switch
|
||||
:active waku-bloom-filter-mode}
|
||||
{:size :small
|
||||
:title (i18n/label :t/set-currency)
|
||||
:accessibility-label :wallet-change-currency
|
||||
:on-press #(hide-sheet-and-dispatch
|
||||
[:navigate-to :currency-settings])
|
||||
:chevron true}]))
|
||||
:active webview-debug}]))
|
||||
|
||||
(defn- flat-list-data
|
||||
[options]
|
||||
@@ -128,10 +114,9 @@
|
||||
|
||||
(views/defview advanced-settings
|
||||
[]
|
||||
(views/letsubs [{:keys [webview-debug]} [:profile/profile]
|
||||
(views/letsubs [webview-debug [:profile/webview-debug]
|
||||
light-client-enabled? [:profile/light-client-enabled?]
|
||||
network-name [:network-name]
|
||||
waku-bloom-filter-mode [:waku/bloom-filter-mode]
|
||||
wakuv2-flag [:waku/v2-flag]
|
||||
transactions-management-enabled? [:wallet-legacy/transactions-management-enabled?]
|
||||
current-log-level [:log-level/current-log-level]
|
||||
current-fleet [:fleets/current-fleet]]
|
||||
@@ -140,10 +125,9 @@
|
||||
{:network-name network-name
|
||||
:current-log-level current-log-level
|
||||
:transactions-management-enabled? transactions-management-enabled?
|
||||
:light-client-enabled? light-client-enabled?
|
||||
:current-fleet current-fleet
|
||||
:dev-mode? false
|
||||
:wakuv2-flag wakuv2-flag
|
||||
:waku-bloom-filter-mode waku-bloom-filter-mode
|
||||
:webview-debug webview-debug})
|
||||
:key-fn (fn [_ i] (str i))
|
||||
:render-fn render-item}]))
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
(ns status-im.ui.screens.fleet-settings.views
|
||||
(:require
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.node.core :as node]
|
||||
[status-im.ui.components.icons.icons :as icons]
|
||||
[status-im.ui.components.list.views :as list]
|
||||
[status-im.ui.components.react :as react]
|
||||
|
||||
@@ -2,22 +2,11 @@
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[status-im.node.core :as node]
|
||||
[status-im2.navigation.events :as navigation]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(rf/defn switch-waku-bloom-filter-mode
|
||||
{:events [:multiaccounts.ui/waku-bloom-filter-mode-switched]}
|
||||
[cofx enabled?]
|
||||
(rf/merge cofx
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:waku-bloom-filter-mode
|
||||
enabled?
|
||||
{})
|
||||
(node/prepare-new-config
|
||||
{:on-success #(re-frame/dispatch [:logout])})))
|
||||
|
||||
(def address-regex #"/ip4/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/tcp/\d{1,5}/p2p/[a-zA-Z0-9]+")
|
||||
|
||||
@@ -108,13 +97,16 @@
|
||||
vals
|
||||
(map #(vector (:name %1) (:address %1)))
|
||||
(into {}))]
|
||||
(rf/merge cofx
|
||||
{:db (-> db
|
||||
(assoc-in [:profile/profile :wakuv2-config :CustomNodes] new-nodes)
|
||||
(dissoc :wakuv2-nodes/manage :wakuv2-nodes/list))
|
||||
:dispatch [:navigate-back]}
|
||||
(node/prepare-new-config
|
||||
{:on-success #(re-frame/dispatch [:logout])}))))
|
||||
{:db (-> db
|
||||
(assoc-in [:profile/profile :wakuv2-config :CustomNodes] new-nodes)
|
||||
(dissoc :wakuv2-nodes/manage :wakuv2-nodes/list))
|
||||
:json-rpc/call [{:method "wakuext_setCustomNodes"
|
||||
:params [{:customNodes new-nodes}]
|
||||
:on-success #(log/info "updated custom nodes")
|
||||
:on-error #(log/error "failed to set custom nodes"
|
||||
{:error %
|
||||
:custom-nodes new-nodes})}]
|
||||
:dispatch [:navigate-back]}))
|
||||
|
||||
(rf/defn show-delete-node-confirmation
|
||||
{:events [:wakuv2.ui/delete-pressed]}
|
||||
@@ -131,3 +123,17 @@
|
||||
(rf/merge cofx
|
||||
(delete id)
|
||||
(navigation/navigate-back)))
|
||||
|
||||
(rf/defn toggle-light-client
|
||||
{:events [:wakuv2.ui/toggle-light-client]}
|
||||
[{:keys [db]} enabled?]
|
||||
{:db (assoc-in db [:profile/profile :wakuv2-config :LightClient] enabled?)
|
||||
|
||||
:json-rpc/call [{:method "wakuext_setLightClient"
|
||||
:params [{:enabled enabled?}]
|
||||
:on-success (fn []
|
||||
(log/info "light client set successfully" enabled?)
|
||||
(re-frame/dispatch [:logout]))
|
||||
:on-error #(log/error "failed to set light client"
|
||||
{:error %
|
||||
:enabled? enabled?})}]})
|
||||
|
||||
@@ -6,8 +6,10 @@
|
||||
[status-im2.common.confirmation-drawer.view :as confirmation-drawer]
|
||||
[status-im2.common.mute-drawer.view :as mute-drawer]
|
||||
[status-im2.common.muting.helpers :refer [format-mute-till]]
|
||||
[status-im2.config :as config]
|
||||
[status-im2.constants :as constants]
|
||||
[status-im2.contexts.communities.actions.chat.view :as chat-actions]
|
||||
[status-im2.contexts.chat.actions.view :as chat-actions]
|
||||
[status-im2.contexts.communities.actions.chat.view :as communities-chat-actions]
|
||||
[status-im2.contexts.contacts.drawers.nickname-drawer.view :as nickname-drawer]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
@@ -253,16 +255,6 @@
|
||||
:chevron? true
|
||||
:add-divider? add-divider?}))
|
||||
|
||||
;; TODO(OmarBasem): Requires design input.
|
||||
(defn fetch-messages-entry
|
||||
[]
|
||||
(entry {:icon :i/save
|
||||
:label (i18n/label :t/fetch-messages)
|
||||
:on-press #(js/alert "TODO: to be implemented, requires design input")
|
||||
:danger? false
|
||||
:accessibility-label :fetch-messages
|
||||
:sub-label nil
|
||||
:chevron? true}))
|
||||
|
||||
(defn remove-from-contacts-entry
|
||||
[contact]
|
||||
@@ -419,8 +411,8 @@
|
||||
[(mark-as-read-entry chat-id needs-divider?)
|
||||
(mute-chat-entry chat-id chat-type muted-till)
|
||||
(notifications-entry false)
|
||||
(when inside-chat?
|
||||
(fetch-messages-entry))
|
||||
(when (and config/fetch-messages-enabled? inside-chat?)
|
||||
(chat-actions/fetch-messages chat-id))
|
||||
(when (or (not group-chat) public?)
|
||||
(show-qr-entry))
|
||||
(when-not group-chat
|
||||
@@ -481,7 +473,7 @@
|
||||
constants/private-group-chat-type
|
||||
[private-group-chat-actions chat inside-chat?]
|
||||
constants/community-chat-type
|
||||
[chat-actions/actions chat inside-chat?]
|
||||
[communities-chat-actions/actions chat inside-chat?]
|
||||
nil))
|
||||
|
||||
(defn group-details-actions
|
||||
|
||||
@@ -172,3 +172,4 @@
|
||||
(def shell-navigation-disabled? false)
|
||||
|
||||
(def community-accounts-selection-enabled? false)
|
||||
(def fetch-messages-enabled? (enabled? (get-config :FETCH_MESSAGES_ENABLED "1")))
|
||||
|
||||
@@ -4,6 +4,19 @@
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn fetch-messages!
|
||||
[chat-id]
|
||||
(rf/dispatch [:hide-bottom-sheet])
|
||||
(rf/dispatch [:chat/fetch-messages chat-id]))
|
||||
|
||||
(defn fetch-messages
|
||||
[chat-id]
|
||||
{:icon :i/download
|
||||
:right-icon :i/chevron-right
|
||||
:accessibility-label :chat-fetch-messages
|
||||
:on-press (partial fetch-messages! chat-id)
|
||||
:label (i18n/label :t/fetch-messages)})
|
||||
|
||||
(defn new-chat
|
||||
[]
|
||||
[quo/action-drawer
|
||||
|
||||
@@ -434,3 +434,11 @@
|
||||
{:events [:chat/check-last-chat]}
|
||||
[{:keys [db]}]
|
||||
{:effects.chat/open-last-chat (get-in db [:profile/profile :key-uid])})
|
||||
|
||||
(rf/defn fetch-messages
|
||||
{:events [:chat/fetch-messages]}
|
||||
[_ chat-id]
|
||||
{:json-rpc/call [{:method "wakuext_fetchMessages"
|
||||
:params [{:id chat-id}]
|
||||
:on-success #()
|
||||
:on-error #(log/error "failed to fetch messages for chat" chat-id %)}]})
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
[status-im2.common.mute-drawer.view :as mute-drawer]
|
||||
[status-im2.common.muting.helpers :refer [format-mute-till]]
|
||||
[status-im2.common.not-implemented :as not-implemented]
|
||||
[status-im2.config :as config]
|
||||
[status-im2.contexts.chat.actions.view :as chat-actions]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
@@ -83,13 +85,6 @@
|
||||
:on-press not-implemented/alert
|
||||
:label (i18n/label :t/pinned-messages)})
|
||||
|
||||
(defn- action-fetch-messages
|
||||
[]
|
||||
{:icon :i/download
|
||||
:right-icon :i/chevron-right
|
||||
:accessibility-label :chat-fetch-messages
|
||||
:on-press not-implemented/alert
|
||||
:label (i18n/label :t/fetch-messages)})
|
||||
|
||||
(defn- action-invite-people
|
||||
[]
|
||||
@@ -141,7 +136,8 @@
|
||||
(action-mark-as-read)
|
||||
(action-toggle-muted chat-id muted muted-till chat-type)
|
||||
(action-notification-settings)
|
||||
(action-fetch-messages)
|
||||
(when config/fetch-messages-enabled?
|
||||
(chat-actions/fetch-messages chat-id))
|
||||
(action-invite-people)
|
||||
(action-qr-code)
|
||||
(action-share)]]]
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
(ns status-im2.contexts.profile.rpc
|
||||
(:require
|
||||
clojure.set
|
||||
[clojure.string :as string]
|
||||
[utils.ens.core :as utils.ens]))
|
||||
|
||||
(defn rpc->wakuv2-config
|
||||
[wakuv2-config]
|
||||
(-> wakuv2-config
|
||||
(clojure.set/rename-keys {:LightClient :light-client})))
|
||||
|
||||
(defn rpc->profiles-overview
|
||||
[{:keys [customizationColor keycard-pairing] :as profile}]
|
||||
(if (map? profile)
|
||||
(-> profile
|
||||
(update :wakuv2-config rpc->wakuv2-config)
|
||||
(dissoc :customizationColor)
|
||||
(assoc :customization-color (keyword customizationColor))
|
||||
(assoc :ens-name? (utils.ens/is-valid-eth-name? (:name profile)))
|
||||
|
||||
@@ -166,7 +166,6 @@
|
||||
[status-im2.contexts.quo-preview.text-combinations.preview :as
|
||||
text-combinations]
|
||||
[status-im2.contexts.quo-preview.text-combinations.standard-title :as standard-title]
|
||||
[status-im2.contexts.quo-preview.text-combinations.username :as username]
|
||||
[status-im2.contexts.quo-preview.wallet.account-card :as account-card]
|
||||
[status-im2.contexts.quo-preview.wallet.account-origin :as account-origin]
|
||||
[status-im2.contexts.quo-preview.wallet.account-overview :as
|
||||
@@ -462,9 +461,7 @@
|
||||
{:name :channel-name
|
||||
:component channel-name/view}
|
||||
{:name :standard-title
|
||||
:component standard-title/view}
|
||||
{:name :username
|
||||
:component username/view}]
|
||||
:component standard-title/view}]
|
||||
:wallet [{:name :account-card :component account-card/view}
|
||||
{:name :account-origin :component account-origin/view}
|
||||
{:name :account-overview
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
(ns status-im2.contexts.quo-preview.text-combinations.username
|
||||
(:require [quo.core :as quo]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.contexts.quo-preview.preview :as preview]))
|
||||
|
||||
(def descriptor
|
||||
[{:key :name-type
|
||||
:type :select
|
||||
:options [{:key :default}
|
||||
{:key :ens
|
||||
:value "ENS"}
|
||||
{:key :nickname}]}
|
||||
{:key :username
|
||||
:type :text}
|
||||
{:key :name
|
||||
:type :text}
|
||||
{:key :status
|
||||
:type :select
|
||||
:options [{:key nil
|
||||
:value "(Nothing)"}
|
||||
{:key :verified}
|
||||
{:key :contact}
|
||||
{:key :untrustworthy}
|
||||
{:key :untrustworthy-contact}
|
||||
{:key :blocked}]}
|
||||
{:key :blur?
|
||||
:type :boolean}])
|
||||
|
||||
(defn- set-username-based-on-name-type
|
||||
[_ ratom {previous-type :name-type} {new-type :name-type}]
|
||||
(when (not= previous-type new-type)
|
||||
(swap! ratom assoc
|
||||
:username
|
||||
(if (= new-type :ens)
|
||||
"juan.eth"
|
||||
"Juanito Mdz"))))
|
||||
|
||||
(defn view
|
||||
[]
|
||||
(let [state (reagent/atom {:name-type :default
|
||||
:username "Juanito Mdz"
|
||||
:name "Juan Méndez"
|
||||
:status nil
|
||||
:blur? true})
|
||||
_ (add-watch state :on-state-change set-username-based-on-name-type)]
|
||||
(fn []
|
||||
[preview/preview-container
|
||||
{:state state
|
||||
:descriptor descriptor
|
||||
:show-blur-background? true
|
||||
:blur? (:blur? @state)}
|
||||
[quo/username @state]])))
|
||||
@@ -15,7 +15,6 @@
|
||||
(defn get-derivation-path
|
||||
[number-of-accounts]
|
||||
(str constants/path-wallet-root "/" number-of-accounts))
|
||||
|
||||
(defn format-derivation-path
|
||||
[path]
|
||||
(string/replace path "/" " / "))
|
||||
|
||||
@@ -63,6 +63,18 @@
|
||||
(fn [{:keys [public-key]}]
|
||||
public-key))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:profile/webview-debug
|
||||
:<- [:profile/profile]
|
||||
(fn [{:keys [webview-debug]}]
|
||||
webview-debug))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:profile/light-client-enabled?
|
||||
:<- [:profile/profile]
|
||||
(fn [profile]
|
||||
(get-in profile [:wakuv2-config :LightClient])))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:multiaccount/contact
|
||||
:<- [:profile/profile]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "do_waku2_nodes",
|
||||
"commit-sha1": "4f870a27d4a9391d4140c5154dd510d3f57ffdc9",
|
||||
"src-sha256": "0d86sa4z7fz7prs1rcbkz8gqaam7zc4dkcnyr1965zc5j7d65qzh"
|
||||
"version": "v0.171.28",
|
||||
"commit-sha1": "d7e7792b51f79e8cbebc9f59de79e64b6f6e684a",
|
||||
"src-sha256": "0y0di4jfmk93pqc4i9fsgasrhqgvwh46ly5h04m87pm611faa2ay"
|
||||
}
|
||||
|
||||
@@ -2376,6 +2376,7 @@
|
||||
"edit-derivation-path": "Edit derivation path",
|
||||
"path-format": "Path format",
|
||||
"reset": "Reset",
|
||||
"light-client-enabled": "Light client",
|
||||
"reveal-address": "Reveal address",
|
||||
"derive-addresses": "Derive addresses",
|
||||
"sign transactions": "sign transactions",
|
||||
|
||||
Reference in New Issue
Block a user