Fixed error on login with attempt to save wrong key into account

Signed-off-by: Volodymyr Kozieiev <vkjr.sp@gmail.com>
This commit is contained in:
Volodymyr Kozieiev 2021-04-09 14:00:32 +03:00
parent 4129ca1597
commit e307b4faa6
No known key found for this signature in database
GPG Key ID: 82B04968DF4C0535
5 changed files with 7 additions and 14 deletions

View File

@ -63,8 +63,7 @@
(fx/defn save-link-preview-whitelist
{:events [::link-preview-whitelist-received]}
[cofx whitelist]
(fx/merge cofx
(multiaccounts.update/multiaccount-update
:link-previews-whitelist whitelist {})))
[{:keys [db]} whitelist]
{:db (assoc db :link-previews-whitelist
whitelist)})

View File

@ -11,6 +11,7 @@
:current-chat-id nil
:selected-participants #{}
:sync-state :done
:link-previews-whitelist []
:app-state "active"
:wallet wallet.db/default-wallet
:wallet/all-tokens {}

View File

@ -79,6 +79,7 @@
(reg-root-key-sub :app-active-since :app-active-since)
(reg-root-key-sub :connectivity/ui-status-properties :connectivity/ui-status-properties)
(reg-root-key-sub :logged-in-since :logged-in-since)
(reg-root-key-sub :link-previews-whitelist :link-previews-whitelist)
;;NOTE this one is not related to ethereum network
;; it is about cellular network/ wifi network
@ -2545,14 +2546,6 @@
;; LINK PREVIEW ========================================================================================================
(re-frame/reg-sub
:link-preview/whitelist
:<- [:multiaccount]
(fn [multiaccount]
(filter (fn [{:keys [address]}]
(config/link-preview-enabled-site? address))
(get multiaccount :link-previews-whitelist))))
(re-frame/reg-sub
:link-preview/cache
:<- [:multiaccount]

View File

@ -91,7 +91,7 @@
(defview link-preview-wrapper [links outgoing timeline]
(letsubs
[ask-user? [:link-preview/link-preview-request-enabled]
whitelist [:link-preview/whitelist]
whitelist [:link-previews-whitelist]
enabled-sites [:link-preview/enabled-sites]]
(when links
(let [link-info (previewable-link links whitelist enabled-sites)

View File

@ -22,7 +22,7 @@
[::link-preview/enable title ((complement boolean) enabled?)])})))
(views/defview link-previews-settings []
(views/letsubs [link-previews-whitelist [:link-preview/whitelist]
(views/letsubs [link-previews-whitelist [:link-previews-whitelist]
link-previews-enabled-sites [:link-preview/enabled-sites]]
(let [all-enabled (= (count link-previews-whitelist) (count link-previews-enabled-sites))]
[react/view {:flex 1}