From 8ed1797f4435fa83af18555269b23aa99b1ceebf Mon Sep 17 00:00:00 2001 From: flexsurfer Date: Thu, 2 Jun 2022 12:16:18 +0200 Subject: [PATCH] [#13433] Input field in chat view is not cleared after logging out (#13438) --- src/status_im/multiaccounts/logout/core.cljs | 1 + src/status_im/ui/screens/chat/components/input.cljs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/status_im/multiaccounts/logout/core.cljs b/src/status_im/multiaccounts/logout/core.cljs index 75b9826efd..8350a87a7e 100644 --- a/src/status_im/multiaccounts/logout/core.cljs +++ b/src/status_im/multiaccounts/logout/core.cljs @@ -15,6 +15,7 @@ (let [key-uid (get-in db [:multiaccount :key-uid])] (fx/merge cofx {:init-root-fx :progress + :chat.ui/clear-inputs nil :hide-popover nil ::logout nil ::multiaccounts/webview-debug-changed false diff --git a/src/status_im/ui/screens/chat/components/input.cljs b/src/status_im/ui/screens/chat/components/input.cljs index 853e7fd7b5..d7a7696f8f 100644 --- a/src/status_im/ui/screens/chat/components/input.cljs +++ b/src/status_im/ui/screens/chat/components/input.cljs @@ -114,6 +114,13 @@ (defonce mentions-enabled (reagent/atom {})) (defonce chat-input-key (reagent/atom 1)) +(re-frame/reg-fx + :chat.ui/clear-inputs + (fn [] + (reset! input-texts {}) + (reset! mentions-enabled {}) + (reset! chat-input-key 1))) + (defn force-text-input-update! "force-text-input-update! forces the input to re-render, necessary when we are setting value"