I swear I'm at my limit
This commit is contained in:
@@ -3,16 +3,11 @@
|
||||
import { scoreStore } from "$lib/stores/scoreStore.ts";
|
||||
import LeaderBoard from "$lib/components/LeaderBoard.svelte";
|
||||
|
||||
let scores;
|
||||
|
||||
onMount(async () => {
|
||||
scores = await scoreStore;
|
||||
await scoreStore.loadData();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
{#if scores}
|
||||
<LeaderBoard bind:scores={$scores}></LeaderBoard>
|
||||
{:else}
|
||||
<p>Loading leaderboard...</p>
|
||||
{/if}
|
||||
<LeaderBoard bind:scores={$scoreStore}></LeaderBoard>
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import {onMount} from "svelte";
|
||||
import {scoreStore} from "$lib/stores/scoreStore.ts";
|
||||
|
||||
let scores;
|
||||
|
||||
let playerName = undefined;
|
||||
let range = 100;
|
||||
let result = 0;
|
||||
@@ -26,7 +28,7 @@
|
||||
toggleLoading();
|
||||
window.$(".result").text(`Result : ${result}/${range}`)
|
||||
|
||||
scoreStore.add(playerName, result)
|
||||
await scoreStore.add(playerName, result)
|
||||
}
|
||||
|
||||
function toggleLoading(){
|
||||
|
||||
Reference in New Issue
Block a user