From 1202e76eb8b6a1ce59c374b66baf46a3a48c48f1 Mon Sep 17 00:00:00 2001 From: Konstantin Date: Tue, 6 Feb 2024 13:04:58 +0300 Subject: [PATCH] =?UTF-8?q?process=20%2=D0=A1=20as=20comma=20in=20collab?= =?UTF-8?q?=20links?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- excalidraw-app/data/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/excalidraw-app/data/index.ts b/excalidraw-app/data/index.ts index 5699568b4..19b0300bd 100644 --- a/excalidraw-app/data/index.ts +++ b/excalidraw-app/data/index.ts @@ -122,7 +122,7 @@ export type SocketUpdateData = _brand: "socketUpdateData"; }; -const RE_COLLAB_LINK = /^#room=([a-zA-Z0-9_-]+),([a-zA-Z0-9_-]+)$/; +const RE_COLLAB_LINK = /^#room=([a-zA-Z0-9_-]+)(,|%2C)([a-zA-Z0-9_-]+)$/; export const isCollaborationLink = (link: string) => { const hash = new URL(link).hash; @@ -132,11 +132,11 @@ export const isCollaborationLink = (link: string) => { export const getCollaborationLinkData = (link: string) => { const hash = new URL(link).hash; const match = hash.match(RE_COLLAB_LINK); - if (match && match[2].length !== 22) { + if (match && match[3].length !== 22) { window.alert(t("alerts.invalidEncryptionKey")); return null; } - return match ? { roomId: match[1], roomKey: match[2] } : null; + return match ? { roomId: match[1], roomKey: match[3] } : null; }; export const generateCollaborationLinkData = async () => {