Wallet: Disable long-press feature on tokens in watch-only accounts. #18597 (#18598)

* add functionality

* update condition
This commit is contained in:
mmilad75 2024-01-26 21:30:01 +03:30 committed by GitHub
parent 550fa04e33
commit be618bfafe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 7 deletions

View File

@ -41,10 +41,12 @@
(defn view (defn view
[item] [item]
(let [{:keys [watch-only?]} (rf/sub [:wallet/current-viewing-account])]
[quo/token-value [quo/token-value
(merge item (cond-> item
{:on-long-press (not watch-only?)
(assoc :on-long-press
#(rf/dispatch #(rf/dispatch
[:show-bottom-sheet [:show-bottom-sheet
{:content (fn [] [token-value-drawer item]) {:content (fn [] [token-value-drawer item])
:selected-item (fn [] [quo/token-value item])}])})]) :selected-item (fn [] [quo/token-value item])}])))]))