From 4e7bdd47429ef39682ae57480113734b6342d93a Mon Sep 17 00:00:00 2001 From: virvar Date: Mon, 9 May 2016 17:33:41 +0300 Subject: [PATCH] Fixes --- src/syng_im/components/chat.cljs | 18 +++++++++--------- .../components/chat/input/simple_command.cljs | 16 +++++++++------- src/syng_im/handlers.cljs | 7 ++++--- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/syng_im/components/chat.cljs b/src/syng_im/components/chat.cljs index f448744f0b..43dde33f03 100644 --- a/src/syng_im/components/chat.cljs +++ b/src/syng_im/components/chat.cljs @@ -214,9 +214,9 @@ subtitle])]]]) (defn actions-list-view [] - (let [{:keys [group-chat active]} - (subscribe [:chat-properties [:group-chat :name :contacts :active]])] - (when-let [actions (when (and @group-chat @active) + (let [{:keys [group-chat chat-id]} + (subscribe [:chat-properties [:group-chat :chat-id]])] + (when-let [actions (if @group-chat [{:title "Add Contact to chat" :icon :icon_menu_group :icon-style {:width 25 @@ -241,12 +241,12 @@ :icon :icon_settings :icon-style {:width 20 :height 13} - :handler (fn [])}] - [{:title "Profile" - :icon "icon_menu_group" - :icon-style {:width 25 - :height 19} - :handler #(dispatch [:show-profile navigator (:chat-id chat)])}])] + :handler (fn [])}] + [{:title "Profile" + :icon "icon_menu_group" + :icon-style {:width 25 + :height 19} + :handler #(dispatch [:show-profile @chat-id])}])] [view {:style {:backgroundColor toolbar-background1 :elevation 2 :position :absolute diff --git a/src/syng_im/components/chat/input/simple_command.cljs b/src/syng_im/components/chat/input/simple_command.cljs index 6858500ac9..3c8d5765ab 100644 --- a/src/syng_im/components/chat/input/simple_command.cljs +++ b/src/syng_im/components/chat/input/simple_command.cljs @@ -34,9 +34,9 @@ (let [message-atom (subscribe [:get-chat-command-content])] (fn [command input-options & {:keys [validator]}] (let [message @message-atom] - [view {:style {:flexDirection "column"}} + [view {:style {:flexDirection :column}} [content-suggestions-view] - [view {:style {:flexDirection "row" + [view {:style {:flexDirection :row :height 56 :backgroundColor color-white :elevation 4}} @@ -65,11 +65,13 @@ :placeholder "Type" :placeholderTextColor text2-color :onChangeText set-input-message - :onSubmitEditing send-command} - input-options) - message] - (if (valid? message validator) - [touchable-highlight + :onSubmitEditing (fn [] + (when (valid? message validator) + (send-command)))} + input-options) + message] + (if (valid? message validator) + [touchable-highlight {:on-press send-command :underlay-color :transparent} [view {:style {:marginTop 10 diff --git a/src/syng_im/handlers.cljs b/src/syng_im/handlers.cljs index 9d786c74cb..7c22147fbe 100644 --- a/src/syng_im/handlers.cljs +++ b/src/syng_im/handlers.cljs @@ -451,10 +451,10 @@ (contacts/load-syng-contacts db))) (register-handler :show-profile - (fn [db [action navigator identity]] + (fn [db [action identity]] (log/debug action) (let [db (contacts/set-contact-identity db identity)] - (dispatch [:navigate-to navigator {:view-id :profile} :push]) + (dispatch [:navigate-to :profile]) db))) ;; -- Chats -------------------------------------------------------------- @@ -465,7 +465,8 @@ (let [db (-> db (create-chat chat-id [chat-id] false) (set-current-chat-id chat-id))] - (dispatch [:navigate-to navigator {:view-id :chat} nav-type]) + ;; (dispatch [:navigate-to navigator {:view-id :chat} nav-type]) + (dispatch [:navigate-to :chat]) db))) (register-handler :init-console-chat