From da16d1f69ee312c10cc09e77f52d58f690eee1ab Mon Sep 17 00:00:00 2001 From: Mohsen Date: Mon, 8 Jul 2024 12:27:16 +0330 Subject: [PATCH] [#20571] fix: cleanup save address on mount (#20650) --- .../saved_addresses/add_address_to_save/view.cljs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs b/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs index 171b0d669c..9dcd733970 100644 --- a/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs +++ b/src/status_im/contexts/settings/wallet/saved_addresses/add_address_to_save/view.cljs @@ -36,8 +36,10 @@ (defn- address-input [{:keys [input-value on-change-text paste-into-input clear-input]}] (let [empty-input? (string/blank? input-value) - on-scan-address (rn/use-callback #(rf/dispatch [:open-modal :screen/wallet.scan-address - {:on-result on-change-text}]))] + on-scan-address (rn/use-callback (fn [] + (rf/dispatch [:wallet/clean-scanned-address]) + (rf/dispatch [:open-modal :screen/wallet.scan-address + {:on-result on-change-text}])))] [rn/view {:style style/input-container} [quo/input {:accessibility-label :add-address-to-save @@ -161,7 +163,9 @@ (rf/dispatch [:open-modal :screen/settings.save-address])) [address ens-name? address-or-ens])] - (rn/use-unmount #(rf/dispatch [:wallet/clear-address-to-save])) + (rn/use-mount (fn [] + (rf/dispatch [:wallet/clean-scanned-address]) + (rf/dispatch [:wallet/clear-address-to-save]))) [quo/overlay {:type :shell} [floating-button-page/view {:footer-container-padding 0