Skip to content

Commit

Permalink
Add settings and stickers synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
audriu committed May 5, 2022
1 parent 1b5f08d commit eb9c516
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ local.properties
# VS Code
.vscode/ipch/
.vscode/settings.json
workspace.code-workspace

# node.js
#
Expand Down
1 change: 1 addition & 0 deletions src/status_im/ethereum/json_rpc.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@

(defn call
[{:keys [method params on-success on-error js-response] :as arg}]

(if-let [method-options (json-rpc-api method)]
(let [params (or params [])
{:keys [id on-result subscription?]
Expand Down
7 changes: 6 additions & 1 deletion src/status_im/multiaccounts/update/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
setting setting-value
{:keys [dont-sync? on-success] :or {on-success #()}}]
(let [current-multiaccount (:multiaccount db)]
(prn "------multiaccount-update------" setting setting-value)
(if (empty? current-multiaccount)
;; NOTE: this should never happen, but if it does this is a critical error
;; and it is better to crash than risk having an unstable state
Expand All @@ -42,7 +43,11 @@

(fx/defn optimistic
[{:keys [db] :as cofx} setting setting-value]
(let [current-multiaccount (:multiaccount db)]
(prn "------todo remove---- " setting setting-value)
(let [current-multiaccount (:multiaccount db)
setting-value (if (= :currency setting)
(keyword setting-value)
setting-value)]
{:db (if setting-value
(assoc-in db [:multiaccount setting] setting-value)
(update db :multiaccount dissoc setting))}))
Expand Down
2 changes: 2 additions & 0 deletions src/status_im/stickers/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@
{:events [:stickers/install-pack]}
[{{:keys [multiaccount] :as db} :db :as cofx} id]
(let [pack (get-in db [:stickers/packs id])]

(fx/merge
cofx
{:db (-> db
(assoc-in [:stickers/packs-installed id] pack))}
;;(assoc :stickers/selected-pack id))} TODO it doesn't scroll to selected pack on Android
(prn "-------------save to multi---"(pr-str (assoc (:stickers/packs-installed multiaccount) id pack) {}))
(multiaccounts.update/multiaccount-update
:stickers/packs-installed
(assoc (:stickers/packs-installed multiaccount) id pack)
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.98.5",
"commit-sha1": "640793fe85d9a9eef9eb3712cda1c5a1ceea401a",
"src-sha256": "1k1iw69yw23k29y0b1yvnggjqlmfnwavk4mq1sf2h3wrlb8x47kd"
"version": "d3105a72c884d5787b99415792cb198e9cec4a32",
"commit-sha1": "d3105a72c884d5787b99415792cb198e9cec4a32",
"src-sha256": "03l59kayqi6x1njq0fcg4f6hnyaflc2qspmxshvnrdam1nrczm0r"
}

0 comments on commit eb9c516

Please sign in to comment.