                                             (forms/managed-button
                                              [:button.btn.btn-primary {:data-success-text "Sent"
                                                                        :on-click #(do
-                                                                                    (raise! owner [:invited-team-members {:invitees (invitees org-members-by-handle vcs-users)
+                                                                                    (raise! owner [:invited-team-members {:invitees (invitees state vcs-users)
                                                                                                                           :vcs_type (:vcs_type selected-org)
                                                                                                                           :org-name (:name selected-org)}])
                                                                                     (close-fn))

                 count-users (count users)
                 count-selected (count (filter (fn [[_ user]]
                                                 (:selected? user))
                                               org-members-by-handle))
                 count-with-email (count (filter (fn [[_ user]]
                                                   (-> user :entered-email valid-email?))
                                                 org-members-by-handle))]
             (modal/modal-dialog {:title "Invite Teammates"
                                  :body
                                  (element :body

      (let [new-selected-org (:selected-org new-props)
            new-vcs-users (:vcs-users new-selected-org)
            old-vcs-users (get-in (om/get-props owner) [:selected-org :vcs-users])
            new-show-modal? (:show-modal? new-props)]
        (when (and new-show-modal?
                   (not new-vcs-users))
          (api/get-org-members (:name new-selected-org) (:vcs_type new-selected-org) (om/get-shared owner [:comms :api])))
        (when (not= new-vcs-users old-vcs-users)
          (om/set-state! owner
                         (reduce (fn [acc {:keys [user? email] :as user}]
                                   (if user?
                                     acc
                                     (let [user-state (if-let [component-user (get-user-from-state owner user)]
                                                        component-user
                                                        (let [trimmed-email (some-> email gstr/trim)]
                                                          {:entered-email trimmed-email
                                                           :selected? (valid-email? trimmed-email)}))
                                           user-ident (component-user-ident user)]
                                       (assoc-in acc user-ident user-state))))
                                 {}
                                 new-vcs-users)))))

    om/IRenderState
    (render-state [_ {:keys [org-members-by-type-and-handle] :as state}]
      (component
       (html
        [:div
