diff --git a/src/status_im/communities/core.cljs b/src/status_im/communities/core.cljs index 7a7f1ae3fb..051b4b4f96 100644 --- a/src/status_im/communities/core.cljs +++ b/src/status_im/communities/core.cljs @@ -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] diff --git a/src/status_im2/contexts/communities/actions/request_to_join/view.cljs b/src/status_im2/contexts/communities/actions/request_to_join/view.cljs index 5adcd06b12..89ddfef9cc 100644 --- a/src/status_im2/contexts/communities/actions/request_to_join/view.cljs +++ b/src/status_im2/contexts/communities/actions/request_to_join/view.cljs @@ -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?) diff --git a/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs b/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs index d262de9680..df72d0d3ad 100644 --- a/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs +++ b/src/status_im2/contexts/shell/activity_center/notification/community_request/view.cljs @@ -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))) diff --git a/translations/en.json b/translations/en.json index bd1e8bd555..b4214c295e 100644 --- a/translations/en.json +++ b/translations/en.json @@ -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",