update multiplier on navgation

This commit is contained in:
Alexander Bocken 2024-02-21 13:47:30 +01:00
parent 0bfbb6da10
commit 687063f216
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -1,7 +1,8 @@
<script>
import { onMount } from 'svelte';
import { onNavigate } from "$app/navigation";
export let data
let multiplier = 1
let multiplier;
let custom_mul = "…"
onMount(() => {
@ -9,6 +10,10 @@ onMount(() => {
const urlParams = new URLSearchParams(window.location.search);
multiplier = urlParams.get('multiplier') || 1;
})
onNavigate(() => {
const urlParams = new URLSearchParams(window.location.search);
multiplier = urlParams.get('multiplier') || 1;
})
function convertFloatsToFractions(inputString) {
// Split the input string into individual words