Skip to content

Commit

Permalink
only show commands in one to one chats
Browse files Browse the repository at this point in the history
  • Loading branch information
yenda committed Jan 9, 2020
1 parent bc3b235 commit 9ce47ff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/status_im/subs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,13 @@
(not group-chat)
(assoc :show-input? true)))))

(re-frame/reg-sub
:current-chat/one-to-one-chat?
:<- [:chats/current-raw-chat]
(fn [current-chat]
(not (or (chat.models/group-chat? current-chat)
(chat.models/public-chat? current-chat)))))

(re-frame/reg-sub
:chats/current-chat-message
:<- [:chats/current-chat]
Expand Down
3 changes: 2 additions & 1 deletion src/status_im/ui/screens/chat/input/input.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
input-text [:chats/current-chat-input-text]
result-box [:chats/current-chat-ui-prop :result-box]
input-bottom-sheet [:chats/current-chat-ui-prop :input-bottom-sheet]
one-to-one-chat? [:current-chat/one-to-one-chat?]
state-text (reagent/atom "")]
{:component-will-unmount #(when platform/desktop?
(re-frame/dispatch [:chat.ui/set-chat-input-text @state-text]))
Expand All @@ -176,7 +177,7 @@
[input-view {:single-line-input? single-line-input? :set-text set-text :state-text state-text}]
(when (and input-text-empty? mainnet?)
[stickers/button (= :stickers input-bottom-sheet)])
(when (and input-text-empty?) ;;TODO show only for 1-1 chats?
(when (and one-to-one-chat? input-text-empty? mainnet?)
[extensions/button (= :extensions input-bottom-sheet)])
(when-not input-text-empty?
(if platform/desktop?
Expand Down

0 comments on commit 9ce47ff

Please sign in to comment.