diff --git a/src/legacy/status_im/group_chats/core.cljs b/src/legacy/status_im/group_chats/core.cljs index 212f18c176..d79faf2f10 100644 --- a/src/legacy/status_im/group_chats/core.cljs +++ b/src/legacy/status_im/group_chats/core.cljs @@ -85,11 +85,12 @@ (rf/defn add-members "Add members to a group chat" {:events [:group-chats.ui/add-members-pressed]} - [{{:group-chat/keys [selected-participants]} :db :as cofx} chat-id] - {:json-rpc/call [{:method "wakuext_addMembersToGroupChat" - :params [nil chat-id selected-participants] - :js-response true - :on-success #(re-frame/dispatch [:chat-updated % true])}]}) + [{{:group-chat/keys [selected-participants]} :db} chat-id] + (when (seq selected-participants) + {:json-rpc/call [{:method "wakuext_addMembersToGroupChat" + :params [nil chat-id selected-participants] + :js-response true + :on-success #(re-frame/dispatch [:chat-updated % true])}]})) (rf/defn add-members-from-invitation "Add members to a group chat" diff --git a/src/status_im/contexts/chat/group_details/view.cljs b/src/status_im/contexts/chat/group_details/view.cljs index 2c6a473095..716164bf35 100644 --- a/src/status_im/contexts/chat/group_details/view.cljs +++ b/src/status_im/contexts/chat/group_details/view.cljs @@ -58,6 +58,9 @@ {:keys [admins] :as group} (rf/sub [:chats/chat-by-id chat-id]) current-pk (rf/sub [:multiaccount/public-key]) admin? (get admins current-pk)] + (rn/use-mount (fn [] + (rf/dispatch [:group/clear-added-participants]) + (rf/dispatch [:group/clear-removed-members]))) [rn/view {:flex 1 :margin-top 20} [rn/touchable-opacity {:on-press #(rf/dispatch [:navigate-back]) @@ -174,11 +177,8 @@ :icon :i/add-user :label (i18n/label (if admin? :t/manage-members :t/add-members)) :counter-value (count contacts) - :on-press (fn [] - (rf/dispatch [:group/clear-added-participants]) - (rf/dispatch [:group/clear-removed-members]) - (rf/dispatch [:open-modal :group-add-manage-members - chat-id]))}]}] + :on-press #(rf/dispatch [:open-modal :group-add-manage-members + chat-id])}]}] [rn/section-list {:key-fn :title :sticky-section-headers-enabled false