diff options
| author | secondl1ght <[email protected]> | 2022-08-22 14:30:03 -0400 |
|---|---|---|
| committer | secondl1ght <[email protected]> | 2022-08-22 14:30:03 -0400 |
| commit | 47873912ae85ab99a4fd462c2cb1541e9ceff316 (patch) | |
| tree | 6dea1fbedb9a59a8e57ceeb3461cea675367a11f /src/routes/+layout.svelte | |
| parent | 47fa920b786d1abdf9577fc0854d38cd7514f5c9 (diff) | |
| download | coinos-ui-47873912ae85ab99a4fd462c2cb1541e9ceff316.tar.gz coinos-ui-47873912ae85ab99a4fd462c2cb1541e9ceff316.zip | |
initial hookup of currency rates
Diffstat (limited to 'src/routes/+layout.svelte')
| -rw-r--r-- | src/routes/+layout.svelte | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 12db17c3..4cf819fc 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -5,7 +5,7 @@ import '../app.css'; import { onMount } from 'svelte'; import { connect } from '$lib/socket'; - import { user, token } from '$lib/store'; + import { user, token, rate, rates, selectedRate, conversion } from '$lib/store'; import { page } from '$app/stores'; import { browser } from '$app/env'; import { goto } from '$app/navigation'; @@ -17,6 +17,10 @@ export let data; + $rates = data.rates; + $: $conversion = data.rates[data.user.currency] / $rate; + $: $selectedRate = $rate * $conversion; + let ready = false; onMount(() => { |
