Skip to content

Commit 32689af

Browse files
committed
fix: use uuid regx to distinguish channel id and encoded channel data
1 parent 200a3a0 commit 32689af

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/status_im/router/core.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
(= handler :community-chat)
108108
(:community-data route-params)
109109
(string? (:community-data route-params))
110-
(string/includes? (:community-data route-params) "-"))
110+
(re-find constants/regx-starts-with-uuid (:community-data route-params)))
111111
(assoc-in [:route-params :community-channel-id] (:community-data route-params))
112112

113113
(and equal-end-of-base64url (= handler :user) (:user-data route-params))

src/status_im2/constants.cljs

+1
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@
184184
(def regx-ens #"^(?=.{5,255}$)([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$")
185185
(def regx-address #"^0x[a-fA-F0-9]{40}$")
186186
(def regx-address-contains #"(?i)0x[a-fA-F0-9]{40}")
187+
(def regx-starts-with-uuid #"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")
187188

188189
(def ^:const dapp-permission-contact-code "contact-code")
189190
(def ^:const dapp-permission-web3 "web3")

0 commit comments

Comments
 (0)