Skip to content

Commit

Permalink
fix: use uuid regx to distinguish channel id and encoded channel data
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Nov 2, 2023
1 parent 9d4ac37 commit 669440e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/status_im/router/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
(= handler :community-chat)
(:community-data route-params)
(string? (:community-data route-params))
(string/includes? (:community-data route-params) "-"))
(re-find constants/regx-starts-with-uuid (:community-data route-params)))
(assoc-in [:route-params :community-channel-id] (:community-data route-params))

(and equal-end-of-base64url (= handler :user) (:user-data route-params))
Expand Down
1 change: 1 addition & 0 deletions src/status_im2/constants.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
(def regx-ens #"^(?=.{5,255}$)([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$")
(def regx-address #"^0x[a-fA-F0-9]{40}$")
(def regx-address-contains #"(?i)0x[a-fA-F0-9]{40}")
(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}")

(def ^:const dapp-permission-contact-code "contact-code")
(def ^:const dapp-permission-web3 "web3")
Expand Down

0 comments on commit 669440e

Please sign in to comment.