Skip to content

Commit

Permalink
Fixed issue with not erased topic when joining public chat
Browse files Browse the repository at this point in the history
  • Loading branch information
vkjr committed Jul 2, 2019
1 parent f3d7062 commit 057af07
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/status_im/ui/screens/add_new/new_public_chat/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
[status-im.utils.slurp :refer [slurp]]
[status-im.utils.views :as views]))

(defn- start-chat [topic]
(re-frame/dispatch [:chat.ui/start-public-chat topic {:navigation-reset? true}])
(re-frame/dispatch [:set :public-group-topic nil]))

(defn- chat-name-input [topic error]
[react/view
[react/view (merge add-new.styles/input-container {:margin-top 8})
Expand All @@ -26,8 +30,7 @@
[text-input.view/text-input-with-label
{:container styles/input-container
:on-change-text #(re-frame/dispatch [:set :public-group-topic %])
:on-submit-editing #(when (db/valid-topic? topic)
(re-frame/dispatch [:chat.ui/start-public-chat topic {:navigation-reset? true}]))
:on-submit-editing #(when (db/valid-topic? topic) (start-chat topic))
:auto-capitalize :none
:auto-focus false
:accessibility-label :chat-name-input
Expand All @@ -43,9 +46,7 @@
(first topic)]])

(defn- render-topic [topic]
[react/touchable-highlight {:on-press #(re-frame/dispatch [:chat.ui/start-public-chat
topic
{:navigation-reset? true}])
[react/touchable-highlight {:on-press #(start-chat topic)
:accessibility-label :chat-item}
[react/view
[list/item
Expand Down

0 comments on commit 057af07

Please sign in to comment.