Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #528 from realgolf/527-bug-archive-and-games-do-no…
Browse files Browse the repository at this point in the history
…t-load-anymore

527 bug archive and games do not load anymore
  • Loading branch information
MoinJulian committed May 6, 2024
2 parents e3ac12c + eeb3641 commit 2a425c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/Archive/Game.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const blueData = dataObj.find((obj: { color: string }) => obj.color === 'blue')?.data || [];
// Interleave the data arrays
const interleavedData: { color: string; value: string }[] = [];
let interleavedData: { color: string; value: string }[] = [];
for (let i = 0; i < Math.max(redData.length, blueData.length); i++) {
if (i < redData.length) interleavedData.push({ color: 'red', value: redData[i] });
if (i < blueData.length) interleavedData.push({ color: 'blue', value: blueData[i] });
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/Public/Games/Game.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
export let show_confirmation: boolean;
export let user_username: string | null | undefined;
// Interleave the data arrays
let interleavedData: { color: string; value: string }[] = [];
const dataObj = JSON.parse(data);
// Separate data arrays for each color
const redData = dataObj.find((obj: { color: string }) => obj.color === 'red')?.data || [];
const blueData = dataObj.find((obj: { color: string }) => obj.color === 'blue')?.data || [];
// Interleave the data arrays
const interleavedData: { color: string; value: string }[] = [];
for (let i = 0; i < Math.max(redData.length, blueData.length); i++) {
if (i < redData.length) interleavedData.push({ color: 'red', value: redData[i] });
if (i < blueData.length) interleavedData.push({ color: 'blue', value: blueData[i] });
Expand Down

0 comments on commit 2a425c3

Please sign in to comment.