diff --git a/src/status_im/communities/core.cljs b/src/status_im/communities/core.cljs index 2289b2c6fa..8dfa8d95ce 100644 --- a/src/status_im/communities/core.cljs +++ b/src/status_im/communities/core.cljs @@ -198,15 +198,6 @@ %) (re-frame/dispatch [::failed-to-leave %]))}]})) -(rf/defn status-tag-pressed - {:events [:communities/status-tag-pressed]} - [{:keys [db]} community-id literal] - (let [current-chat-id (:current-chat-id db) - {:keys [id]} (some #(when (= (:name %) literal) %) - (vals (get-in db [:communities community-id :chats])))] - (when-not (= current-chat-id (str community-id id)) - {:dispatch [:chat/navigate-to-chat (str community-id id)]}))) - (rf/defn fetch [_] {:json-rpc/call [{:method "wakuext_communities" diff --git a/src/status_im/ui2/screens/chat/messages/message.cljs b/src/status_im/ui2/screens/chat/messages/message.cljs index 7b3284a77c..4e25f1d8cd 100644 --- a/src/status_im/ui2/screens/chat/messages/message.cljs +++ b/src/status_im/ui2/screens/chat/messages/message.cljs @@ -38,8 +38,7 @@ (rf/sub [:contacts/contact-name-by-identity from])) (defn render-inline - [_message-text content-type acc {:keys [type literal destination]} - community-id] + [_message-text content-type acc {:keys [type literal destination]}] (case type "" (conj acc literal) @@ -81,10 +80,9 @@ "status-tag" (conj acc [rn/text - (when community-id - {:style {:color :blue - :text-decoration-line :underline} - :on-press #(rf/dispatch [:communities/status-tag-pressed community-id literal])}) + {:style {:color :blue + :text-decoration-line :underline} + :on-press #(rf/dispatch [:chat.ui/start-public-chat literal])} "#" literal]) @@ -96,20 +94,13 @@ ;; TEXT (defn render-block [{:keys [content content-type edited-at in-popover?]} acc - {:keys [type ^js literal children]} - community-id] - + {:keys [type ^js literal children]}] (case type "paragraph" (conj acc (reduce - (fn [acc e] - (render-inline (:text content) - content-type - acc - e - community-id)) + (fn [acc e] (render-inline (:text content) content-type acc e)) [rn/text (style/text-style content-type in-popover?)] (conj children @@ -130,16 +121,11 @@ acc)) (defn render-parsed-text - [{:keys [content chat-id] - :as message-data}] - (let [community-id (rf/sub [:community-id-by-chat-id chat-id])] - (reduce (fn [acc e] - (render-block message-data - acc - e - community-id)) - [:<>] - (:parsed-text content)))) + [{:keys [content] :as message-data}] + (reduce (fn [acc e] + (render-block message-data acc e)) + [:<>] + (:parsed-text content))) (defn quoted-message [{:keys [message-id chat-id]} reply pin?] @@ -248,7 +234,7 @@ [rn/view style/status-container [rn/text {:style (style/status-text)} (reduce - (fn [acc e] (render-inline (:text content) content-type acc e nil)) + (fn [acc e] (render-inline (:text content) content-type acc e)) [rn/text {:style (style/status-text)}] (-> content :parsed-text peek :children))]]) diff --git a/src/status_im2/subs/chat/chats.cljs b/src/status_im2/subs/chat/chats.cljs index bfce0f9028..19b85018ab 100644 --- a/src/status_im2/subs/chat/chats.cljs +++ b/src/status_im2/subs/chat/chats.cljs @@ -20,14 +20,6 @@ (fn [chats [_ chat-id]] (get chats chat-id))) -(re-frame/reg-sub - :community-id-by-chat-id - :<- [:chats/chats] - (fn [chats [_ chat-id]] - (-> chats - (get chat-id) - :community-id))) - (re-frame/reg-sub :chats/by-community-id :<- [:chats/chats]