[#13951] feat: merge favourites in saved addresses #2844 (#13993)

This commit is contained in:
flexsurfer 2022-09-13 15:51:31 +02:00 committed by GitHub
parent 9e2990152c
commit b71853c92a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -315,14 +315,14 @@
:on-error reject})))
(js/Promise.
(fn [resolve reject]
(json-rpc/call {:method "wallet_getFavourites"
(json-rpc/call {:method "wallet_getSavedAddresses"
:on-success resolve
:on-error reject})))]))
(.then (fn [[accounts tokens custom-tokens favourites]]
(callback accounts
(normalize-tokens network-id tokens)
(mapv #(update % :symbol keyword) custom-tokens)
favourites)))
(filter :favourite favourites))))
(.catch (fn [_]
(log/error "Failed to initialize wallet"))))))

View File

@ -88,10 +88,11 @@
{:events [:wallet/add-favourite]}
[{:keys [db] :as cofx} address name]
(let [new-favourite {:address address
:name (or name "")}]
:name (or name "")
:favourite true}]
(fx/merge cofx
{:db (assoc-in db [:wallet/favourites address] new-favourite)
::json-rpc/call [{:method "wallet_addFavourite"
::json-rpc/call [{:method "wallet_addSavedAddress"
:params [new-favourite]
:on-success #()}]}
(navigation/navigate-back))))

View File

@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.108.3",
"commit-sha1": "0ecbb5e8d78749abeb9d7bb6dc4c3b4c18b683e5",
"src-sha256": "0shfklq1sisjnj008grcxwfam3j6psbis68r82nv38m8435z3g46"
"version": "v0.109.1",
"commit-sha1": "0170d50702d0e3532d794e104cd0eb0a0687fb14",
"src-sha256": "00sv204ml5qaj827mw190pja0zzsxchdldjcyijak68b5pcr3a9x"
}