Add members to open community
* add members to open community * fix: join open community notification
This commit is contained in:
parent
99294fa8ea
commit
66e3b60703
|
@ -220,15 +220,6 @@
|
|||
(log/error "failed to import community" %)
|
||||
(re-frame/dispatch [::failed-to-import %]))}]})
|
||||
|
||||
(rf/defn join
|
||||
{:events [:communities/join]}
|
||||
[_ community-id]
|
||||
{:json-rpc/call [{:method "wakuext_joinCommunity"
|
||||
:params [community-id]
|
||||
:js-response true
|
||||
:on-success #(re-frame/dispatch [::joined %])
|
||||
:on-error #(log/error "failed to join community" community-id %)}]})
|
||||
|
||||
(rf/defn request-to-join
|
||||
{:events [:communities/request-to-join]}
|
||||
[_ community-id]
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
:on-press (fn []
|
||||
(if can-join?
|
||||
(do
|
||||
(rf/dispatch [:communities/join id])
|
||||
(rf/dispatch [:communities/request-to-join id])
|
||||
(rf/dispatch [:navigate-back]))
|
||||
(do (and can-request-access?
|
||||
(not pending?)
|
||||
|
|
|
@ -21,9 +21,11 @@
|
|||
(defn- get-header-text-and-context
|
||||
[community membership-status]
|
||||
(let [community-name (:name community)
|
||||
permissions (:permissions community)
|
||||
community-image (get-in community [:images :thumbnail :uri])
|
||||
community-context-tag [quo/context-tag common/tag-params community-image
|
||||
community-name]]
|
||||
community-name]
|
||||
open? (not= 3 (:access permissions))]
|
||||
(cond
|
||||
(= membership-status constants/activity-center-membership-status-idle)
|
||||
{:header-text (i18n/label :t/community-request-not-accepted)
|
||||
|
@ -40,9 +42,14 @@
|
|||
community-context-tag]}
|
||||
|
||||
(= membership-status constants/activity-center-membership-status-accepted)
|
||||
{:header-text (i18n/label :t/community-request-accepted)
|
||||
{:header-text (i18n/label (if open?
|
||||
:t/join-open-community
|
||||
:t/community-request-accepted))
|
||||
:context [[quo/text {:style common-style/user-avatar-tag-text}
|
||||
(i18n/label :t/community-request-accepted-body-text)]
|
||||
(i18n/label (if open?
|
||||
:t/joined-community
|
||||
:t/community-request-accepted-body-text)
|
||||
(when open? {:community community-name}))]
|
||||
community-context-tag]}
|
||||
|
||||
:else nil)))
|
||||
|
|
|
@ -196,6 +196,7 @@
|
|||
"communities-verified": "✓ Verified Status Community",
|
||||
"communities-enabled": "Communities enabled",
|
||||
"request-access": "Request access",
|
||||
"requesting": "Requesting",
|
||||
"membership-request-pending": "Membership request pending",
|
||||
"create-community": "Create a community",
|
||||
"create-category": "Create category",
|
||||
|
|
Loading…
Reference in New Issue