Skip to content

Commit

Permalink
chore: reset match_key and teams on send-match
Browse files Browse the repository at this point in the history
  • Loading branch information
azaleacolburn committed Nov 19, 2024
1 parent 273ac9c commit 6692109
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/admin/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
}
});
socket.on('messageFromServer', (data) => console.log(data));
let match_key: string = $state('');
const colors = ['red', 'red', 'red', 'blue', 'blue', 'blue'] as const;
const teams: string[] = $state(['', '', '', '', '', '']);
let teams: string[] = $state(['', '', '', '', '', '']);
const team_color = $derived(
teams.map((team, i) => [team, colors[i]] as [string, 'red' | 'blue'])
);
const queue_match = () => {
socket.emit('send_match', [match_key, team_color]);
match_key = '';
teams = ['', '', '', '', '', ''];
};
</script>

Expand Down

0 comments on commit 6692109

Please sign in to comment.