diff --git a/frontend/src/CreateRoom.svelte b/frontend/src/CreateRoom.svelte index 107c833..6da1d08 100644 --- a/frontend/src/CreateRoom.svelte +++ b/frontend/src/CreateRoom.svelte @@ -3,6 +3,9 @@ import Loading from './Loading.svelte'; import Button from "./Button.svelte"; + let useTeams = false; + let teams = []; + let defaultTeams = ['Dev', 'QA']; let observer = false; let loading = false; let name = ''; @@ -11,7 +14,7 @@ { loading = true; - roomStore.create(name, observer); + roomStore.create(name, teams.length === 0 ? defaultTeams : teams, observer); } function handleKeyUp(event) @@ -22,6 +25,11 @@ createRoom(); } } + + function teamsChanged() + { + teams = document.getElementById('teams').value().trim().split("\n"); + } {#if loading} @@ -29,6 +37,21 @@ {:else}
+ + {#if useTeams} + + + {/if} diff --git a/frontend/src/JoinRoom.svelte b/frontend/src/JoinRoom.svelte index 6372568..9131485 100644 --- a/frontend/src/JoinRoom.svelte +++ b/frontend/src/JoinRoom.svelte @@ -1,18 +1,25 @@ -{#if loading} +{#if roomInfoLoading || joiningRoom} {:else}
@@ -95,4 +102,4 @@ .buttons { margin-top: 2em; } - \ No newline at end of file + diff --git a/frontend/src/RoomControls.svelte b/frontend/src/RoomControls.svelte index 6eecfd5..17e2df1 100644 --- a/frontend/src/RoomControls.svelte +++ b/frontend/src/RoomControls.svelte @@ -8,7 +8,7 @@ socket.addEventListener('message', function (event) { const message = JSON.parse(event.data); - if ((message.action === 'roomsettingschanged' && message.data.votes_revealed === true) || message.action === 'votesreset') { + if ((message.action === 'roomupdate' && message.data.votes_revealed === true) || message.action === 'votesreset') { disable_buttons = false; } }); diff --git a/frontend/src/store/room.js b/frontend/src/store/room.js index 44496de..7dd435a 100644 --- a/frontend/src/store/room.js +++ b/frontend/src/store/room.js @@ -12,6 +12,7 @@ export default (function () { let room_id = ""; let saved_name = ""; let saved_observer = false; + let isProduction = true; socket.addEventListener('message', function (event) { const message = JSON.parse(event.data); @@ -26,7 +27,7 @@ export default (function () { join(message.data.room_id, saved_name, saved_observer); break; - case 'roomsettingschanged': + case 'roomupdate': room_id = message.data.room_id; update((room) => { diff --git a/lambda/joinroom/index.js b/lambda/joinroom/index.js index 9322e60..ada7216 100644 --- a/lambda/joinroom/index.js +++ b/lambda/joinroom/index.js @@ -113,7 +113,7 @@ exports.handler = async (event) => { ConnectionId: event.requestContext.connectionId, Data: Buffer.from(JSON.stringify( { - "action": "roomsettingschanged", + "action": "roomupdate", "data": roomData } )) diff --git a/lambda/revealvotes/index.js b/lambda/revealvotes/index.js index 650c33d..ca9e073 100644 --- a/lambda/revealvotes/index.js +++ b/lambda/revealvotes/index.js @@ -88,7 +88,7 @@ exports.handler = async (event) => { ConnectionId: voter.voter_id, Data: Buffer.from(JSON.stringify( { - "action": "roomsettingschanged", + "action": "roomupdate", "data": roomData } ))