From 4234c9f965571308bd71a0b13392311daa081e23 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Sun, 30 Jul 2023 16:05:08 +0100 Subject: [PATCH] feat(#15): Enable joining a room within the PWA by pasting the link into a textbox --- src/routes/+page.svelte | 45 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 67f08e4..563a70f 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2,10 +2,20 @@ import { generateId } from './estimation/estimation.js'; import { goto } from '$app/navigation'; + let roomId = ''; + function startARoom() { const roomId = generateId(); goto(`/estimation/${roomId}`); } + + function joinRoom() { + const match = roomId.match(/\/estimation\/(.+)/); + if (match) { + const roomId = match[1]; + goto(`/estimation/${roomId}`); + } + }
@@ -13,6 +23,11 @@ Simply start a room and share the URL to everyone else who needs to join the estimation session.

+
+ + + +