Skip to content

Commit 5ec1f44

Browse files
committed
clean
1 parent 32f6167 commit 5ec1f44

File tree

5 files changed

+65
-112
lines changed

5 files changed

+65
-112
lines changed

src/status_im/config.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
(defn enabled? [v] (= "1" v))
1111

12-
(goog-define INFURA_TOKEN "")
12+
(goog-define INFURA_TOKEN "e5193fde096b4a5d92433107ee22cf75")
1313
(goog-define POKT_TOKEN "3ef2018191814b7e1009b8d9")
1414
(goog-define OPENSEA_API_KEY "")
1515
(goog-define RARIBLE_MAINNET_API_KEY "")

src/status_im/contexts/communities/actions/accounts_selection/view.cljs

+18-20
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
{:keys [name color images joined]} (rf/sub [:communities/community id])
2020
airdrop-account (rf/sub [:communities/airdrop-account id])
2121
revealed-accounts (rf/sub [:communities/accounts-to-reveal id])
22-
key-uid (rf/sub [:profile/key-uid])
2322
{:keys [highest-permission-role]} (rf/sub [:community/token-gated-overview id])
2423
highest-role-text (i18n/label (communities.utils/role->translation-key
2524
highest-permission-role
@@ -51,25 +50,24 @@
5150
(rn/use-callback
5251
(fn []
5352
(rf/dispatch
54-
[:communities/login-with-biometric-if-available
55-
{:key-uid key-uid
56-
:on-success (fn [password]
57-
[:dispatch
58-
[:communities/request-to-join-with-addresses
59-
{:community-id id
60-
:password password}]])
61-
:on-fail (fn [err]
62-
(log/info "Biometric authentication failed" err)
63-
(rf/dispatch
64-
[:password-authentication/show
65-
{:content (fn [] [password-authentication/view])
66-
:community-id id}
67-
{:label (i18n/label :t/join-open-community)
68-
:on-press (fn [password]
69-
(rf/dispatch
70-
[:communities/request-to-join-with-addresses
71-
{:community-id id
72-
:password password}]))}]))}])
53+
[:standard-auth/authorize
54+
{:on-auth-success (fn [password]
55+
[:dispatch
56+
[:communities/request-to-join-with-addresses
57+
{:community-id id
58+
:password password}]])
59+
:on-auth-fail (fn [err]
60+
(log/info "Biometric authentication failed" err)
61+
(rf/dispatch
62+
[:password-authentication/show
63+
{:content (fn [] [password-authentication/view])
64+
:community-id id}
65+
{:label (i18n/label :t/join-open-community)
66+
:on-press (fn [password]
67+
(rf/dispatch
68+
[:communities/request-to-join-with-addresses
69+
{:community-id id
70+
:password password}]))}]))}])
7371
(navigate-back)))]
7472
(rn/use-mount
7573
(fn []

src/status_im/contexts/communities/actions/airdrop_addresses/view.cljs

+31-32
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,42 @@
1414
[{:keys [address emoji] :as account}
1515
_ _
1616
[community-id airdrop-address can-edit-addresses?]]
17-
(let [key-uid (rf/sub [:profile/key-uid])
18-
airdrop-address? (= address airdrop-address)
17+
(let [airdrop-address? (= address airdrop-address)
1918
on-press
2019
(when-not airdrop-address?
2120
(fn []
2221
(if can-edit-addresses?
2322
(rf/dispatch
24-
[:communities/login-with-biometric-if-available
25-
{:key-uid key-uid
26-
:on-fail (fn [err]
27-
(log/info "Biometric authentication failed" err)
28-
(rf/dispatch
29-
[:password-authentication/show
30-
{:content (fn [] [password-authentication/view])}
31-
{:label (i18n/label :t/enter-password)
32-
:on-press (fn [password]
33-
(rf/dispatch
34-
[:communities/edit-shared-addresses
35-
{:community-id community-id
36-
:password password
37-
:airdrop-address address
38-
:on-success (fn []
39-
(rf/dispatch [:dismiss-modal
40-
:address-for-airdrop])
41-
(rf/dispatch
42-
[:hide-bottom-sheet]))}]))}]))
43-
:on-success (fn [password]
44-
[:dispatch
45-
[:communities/edit-shared-addresses
46-
{:community-id community-id
47-
:password password
48-
:airdrop-address address
49-
:on-success (fn []
50-
(rf/dispatch [:dismiss-modal
51-
:address-for-airdrop])
52-
(rf/dispatch
53-
[:hide-bottom-sheet]))}]])}])
23+
[:standard-auth/authorize
24+
{:on-auth-fail (fn [err]
25+
(log/info "Biometric authentication failed" err)
26+
(rf/dispatch
27+
[:password-authentication/show
28+
{:content (fn [] [password-authentication/view])}
29+
{:label (i18n/label :t/enter-password)
30+
:on-press (fn [password]
31+
(rf/dispatch
32+
[:communities/edit-shared-addresses
33+
{:community-id community-id
34+
:password password
35+
:airdrop-address address
36+
:on-success (fn []
37+
(rf/dispatch
38+
[:dismiss-modal
39+
:address-for-airdrop])
40+
(rf/dispatch
41+
[:hide-bottom-sheet]))}]))}]))
42+
:on-auth-success (fn [password]
43+
[:dispatch
44+
[:communities/edit-shared-addresses
45+
{:community-id community-id
46+
:password password
47+
:airdrop-address address
48+
:on-success (fn []
49+
(rf/dispatch [:dismiss-modal
50+
:address-for-airdrop])
51+
(rf/dispatch
52+
[:hide-bottom-sheet]))}]])}])
5453
(do
5554
(rf/dispatch [:communities/set-airdrop-address community-id address])
5655
(rf/dispatch [:hide-bottom-sheet])))))]

src/status_im/contexts/communities/actions/request_to_join/view.cljs

+15-17
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,28 @@
1313
[utils.re-frame :as rf]))
1414

1515
(defn join-community-and-navigate-back
16-
[id key-uid]
16+
[id]
1717
(rf/dispatch
18-
[:communities/login-with-biometric-if-available
19-
{:key-uid key-uid
20-
:on-success (fn [password]
21-
[:dispatch
22-
[:communities/request-to-join
23-
{:community-id id :password password}]])
24-
:on-fail (fn [err]
25-
(log/info "Biometric authentication failed" err)
26-
(rf/dispatch [:password-authentication/show
27-
{:content (fn [] [password-authentication/view])}
28-
{:label (i18n/label :t/join-open-community)
29-
:on-press #(rf/dispatch [:communities/request-to-join
30-
{:community-id id :password %}])}]))}])
18+
[:standard-auth/authorize
19+
{:on-auth-success (fn [password]
20+
[:dispatch
21+
[:communities/request-to-join
22+
{:community-id id :password password}]])
23+
:on-auth-fail (fn [err]
24+
(log/info "Biometric authentication failed" err)
25+
(rf/dispatch [:password-authentication/show
26+
{:content (fn [] [password-authentication/view])}
27+
{:label (i18n/label :t/join-open-community)
28+
:on-press #(rf/dispatch [:communities/request-to-join
29+
{:community-id id :password %}])}]))}])
3130

3231
(rf/dispatch [:navigate-back]))
3332

3433
(defn- view-internal
3534
[{:keys [theme]}]
3635
(fn []
3736
(let [{:keys [id]} (rf/sub [:get-screen-params])
38-
{:keys [color name images]} (rf/sub [:communities/community id])
39-
key-uid (rf/sub [:profile/key-uid])]
37+
{:keys [color name images]} (rf/sub [:communities/community id])]
4038
[rn/safe-area-view {:flex 1}
4139
[gesture/scroll-view {:style style/container}
4240
[rn/view style/page-container
@@ -68,7 +66,7 @@
6866
(i18n/label :t/cancel)]
6967
[quo/button
7068
{:accessibility-label :join-community-button
71-
:on-press #(join-community-and-navigate-back id key-uid)
69+
:on-press #(join-community-and-navigate-back id)
7270
:container-style {:flex 1}
7371
:inner-style {:background-color (colors/resolve-color color theme)}}
7472
(i18n/label :t/request-to-join)]]

src/status_im/contexts/communities/auth/auth.cljs

-42
This file was deleted.

0 commit comments

Comments
 (0)