Skip to content

Commit 08a44bb

Browse files
committed
fast create community to test
1 parent b8d01c8 commit 08a44bb

File tree

7 files changed

+55
-5
lines changed

7 files changed

+55
-5
lines changed

.env.e2e

+1
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ DELETE_MESSAGE_ENABLED=1
3232
TWO_MINUTES_SYNCING=1
3333
STICKERS_TEST_ENABLED=1
3434
LOCAL_PAIRING_ENABLED=1
35+
FAST_CREATE_COMMUNITY_ENABLED=1

.env.jenkins

+1
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ TWO_MINUTES_SYNCING=1
3434
ENABLE_QUO_PREVIEW=1
3535
STICKERS_TEST_ENABLED=1
3636
LOCAL_PAIRING_ENABLED=1
37+
FAST_CREATE_COMMUNITY_ENABLED=1

.env.nightly

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ BLANK_PREVIEW=0
2121
COMMUNITIES_ENABLED=1
2222
DATABASE_MANAGEMENT_ENABLED=1
2323
DELETE_MESSAGE_ENABLED=1
24+
FAST_CREATE_COMMUNITY_ENABLED=0

src/status_im/communities/core.cljs

+30
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,36 @@
532532
{:db (assoc db :communities/create {:membership constants/community-no-membership-access})}
533533
(navigation/navigate-to :community-create nil)))
534534

535+
(rf/defn create-closed-community
536+
{:events [:fast-create-community/create-closed-community]}
537+
[_]
538+
{:json-rpc/call [{:method "wakuext_createClosedCommunity"
539+
:params []
540+
:js-response true
541+
:on-success #(rf/dispatch [:sanitize-messages-and-process-response %])
542+
:on-error #(log/error "failed to create closed community." {:error %})}]
543+
:dispatch [:hide-bottom-sheet]})
544+
545+
(rf/defn create-open-community
546+
{:events [:fast-create-community/create-open-community]}
547+
[_]
548+
{:json-rpc/call [{:method "wakuext_createOpenCommunity"
549+
:params []
550+
:js-response true
551+
:on-success #(rf/dispatch [:sanitize-messages-and-process-response %])
552+
:on-error #(log/error "failed to create open community." {:error %})}]
553+
:dispatch [:hide-bottom-sheet]})
554+
555+
(rf/defn create-token-gated-community
556+
{:events [:fast-create-community/create-token-gated-community]}
557+
[_]
558+
{:json-rpc/call [{:method "wakuext_createTokenGatedCommunity"
559+
:params []
560+
:js-response true
561+
:on-success #(rf/dispatch [:sanitize-messages-and-process-response %])
562+
:on-error #(log/error "failed to create token gated community." {:error %})}]
563+
:dispatch [:hide-bottom-sheet]})
564+
535565
(rf/defn open-edit-community
536566
{:events [::open-edit-community :communities/open-edit-community]}
537567
[{:keys [db] :as cofx} id]

src/status_im2/config.cljs

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
(get-config :VERIFY_ENS_CONTRACT_ADDRESS
6969
((ethereum/chain-id->chain-keyword verify-ens-chain-id) ens/ens-registries)))
7070

71+
(def fast-create-community-enabled?
72+
(enabled? (get-config :FAST_CREATE_COMMUNITY_ENABLED "0")))
73+
7174
(def default-multiaccount
7275
{:preview-privacy? blank-preview?
7376
:wallet/visible-tokens {:mainnet #{:SNT}}

src/status_im2/contexts/communities/actions/home_plus/view.cljs

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(ns status-im2.contexts.communities.actions.home-plus.view
22
(:require [quo2.core :as quo]
3-
[utils.re-frame :as rf]))
3+
[utils.re-frame :as rf]
4+
[status-im2.config :as config]))
45

56
(defn view
67
[]
@@ -12,4 +13,17 @@
1213
{:icon :i/communities
1314
:accessibility-label :create-community
1415
:label "Create community (only for e2e)"
15-
:on-press #(rf/dispatch [:legacy-only-for-e2e/open-create-community])}]]])
16+
:on-press #(rf/dispatch [:legacy-only-for-e2e/open-create-community])}
17+
(when config/fast-create-community-enabled?
18+
{:icon :i/communities
19+
:accessibility-label :create-closed-community
20+
:label "Create closed community"
21+
:on-press #(rf/dispatch [:fast-create-community/create-closed-community])}
22+
{:icon :i/communities
23+
:accessibility-label :create-open-community
24+
:label "Create open community"
25+
:on-press #(rf/dispatch [:fast-create-community/create-open-community])}
26+
{:icon :i/communities
27+
:accessibility-label :create-token-gated-community
28+
:label "Create token-gated community"
29+
:on-press #(rf/dispatch [:fast-create-community/create-token-gated-community])})]]])

status-go-version.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
44
"owner": "status-im",
55
"repo": "status-go",
6-
"version": "v0.162.13",
7-
"commit-sha1": "b81ad3fcac4c8c5c24964fb9f62dedc020ec3eb5",
8-
"src-sha256": "0w69rdpaqm88wa9yxkdg46iw7cvd8aln1c3znzph2wf0803ab1qm"
6+
"version": "feat/create-community-fast",
7+
"commit-sha1": "aa839e03d5cc6ba3958ccab629cb3e630ce001f0",
8+
"src-sha256": "12329877wwr3a02pdmc8nzdwvca7qrad14vgq3lrxb64x0a48z8k"
99
}

0 commit comments

Comments
 (0)