Skip to content

Commit

Permalink
Fixing buttons and alliance colour detection
Browse files Browse the repository at this point in the history
  • Loading branch information
BenM-BenM committed Mar 8, 2024
1 parent 6d81294 commit f17db04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lib/components/AddForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
? "BLUE"
: "ERR")
};
console.log(match)
console.log($matches[parseInt(match)])
$errors[id] = true;
match = "";
team = "";
Expand Down
10 changes: 8 additions & 2 deletions src/lib/components/FormFlow/Counter.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import type { Counter } from "$lib/types";
import { activeResponses } from "$lib/store";
import { getContext } from "svelte";
import { getContext, onMount } from "svelte";
// Set default values if fields are left as undefined
export let component: Counter;
Expand All @@ -14,7 +14,13 @@
export const id: number = getContext("id")
$: count = Number($activeResponses[id].data[component.id]) ?? 0
$: count = Number($activeResponses[id].data[component.id])
onMount( () => {
if (Number($activeResponses[id].data[component.id]) === undefined) {
$activeResponses[id].data[component.id] = 0;
}}
)
// Count is considered to be valid if error
// is undefined!
Expand Down

0 comments on commit f17db04

Please sign in to comment.