From 555eedf7804cf5fa4f963b7fcffeee4f97c0c911 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 07:54:38 -0800 Subject: homepage update --- src/components/About.svelte | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/components') diff --git a/src/components/About.svelte b/src/components/About.svelte index 0a0ff874..b468750d 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -13,21 +13,6 @@ ] }, { name: 'cole', socials: [] }, - { - name: 'john', - socials: [] - }, - { - name: 'shauna', - socials: [ - { type: 'twitter', url: 'https://twitter.com/ShaunaCollister', color: 'bg-[#1D9BF0]' }, - { - type: 'linkedin', - url: 'https://www.linkedin.com/in/shauna-collister-32905214', - color: 'bg-[#0a66c2]' - } - ] - } ]; -- cgit v1.2.3 From ffb2a1c2ccfeb8d6002644e2fcefe60a7fd20d05 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 11 Mar 2023 16:36:40 -0800 Subject: prompt for tip --- src/components/About.svelte | 2 +- .../(app)/[username]/invoice/[hash]/+layout.server.js | 2 +- src/routes/(app)/send/invoice/[id]/+page.server.js | 2 +- .../(app)/send/user/[username]/[...amount]/+page.svelte | 16 +++++----------- src/routes/(app)/sent/+page.server.js | 2 +- 5 files changed, 9 insertions(+), 15 deletions(-) (limited to 'src/components') diff --git a/src/components/About.svelte b/src/components/About.svelte index b468750d..4292b9fd 100644 --- a/src/components/About.svelte +++ b/src/components/About.svelte @@ -12,7 +12,7 @@ { type: 'github', url: 'https://github.com/asoltys', color: 'bg-gray-800' } ] }, - { name: 'cole', socials: [] }, + { name: 'cole', socials: [] } ]; diff --git a/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js b/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js index b5323d3f..7cf87e14 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js +++ b/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js @@ -19,7 +19,7 @@ export async function load({ depends, params, url, parent }) { if (paid && !url.pathname.endsWith('paid')) throw redirect(307, `/${params.username}/invoice/${hash}/paid`); - let sm = Qr.drawImg(invoice.text, { size: 300 }); + let sm = Qr.drawImg(invoice.text || '', { size: 300 }); return { hash, invoice, sm, lg: sm }; } diff --git a/src/routes/(app)/send/invoice/[id]/+page.server.js b/src/routes/(app)/send/invoice/[id]/+page.server.js index 0d23d307..261345fa 100644 --- a/src/routes/(app)/send/invoice/[id]/+page.server.js +++ b/src/routes/(app)/send/invoice/[id]/+page.server.js @@ -6,7 +6,7 @@ export async function load({ params: { id }, parent, url }) { let { amount, address, rate, prompt, tip, text, user: recipient } = await get(`/invoice/${id}`); - if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); + if (prompt && tip === null) throw redirect(307, `/${recipient.username}/invoice/${id}/tip`); if (recipient.username === user.username) throw error(500, { message: 'Cannot send to self' }); return { amount, address, tip, rate, payreq: text, recipient }; } diff --git a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte index 1bb88277..af6a6368 100644 --- a/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte +++ b/src/routes/(app)/send/user/[username]/[...amount]/+page.svelte @@ -30,11 +30,15 @@ ({ hash } = await post(`/${subject.username}/invoice`, { invoice: { amount, + hash: 'internal', rate: rates[subject.currency], + prompt: subject.prompt, type: 'internal' }, user: subject })); + + goto(`/${subject.username}/invoice/${hash}`); }; let loading; @@ -56,17 +60,7 @@ {/if}
- {#if amount} -

Sending

-
-

- {f(amountFiat, currency)} -

-

{sat(amount)}

-
- {:else} - - {/if} +
diff --git a/src/routes/(app)/sent/+page.server.js b/src/routes/(app)/sent/+page.server.js index cfd43472..d949906a 100644 --- a/src/routes/(app)/sent/+page.server.js +++ b/src/routes/(app)/sent/+page.server.js @@ -2,6 +2,6 @@ import { get, auth } from '$lib/utils'; export let load = async ({ cookies }) => { let { payments } = await get('/payments', auth(cookies)); - console.log("HUH", payments[0]) + console.log('HUH', payments[0]); return { payments }; }; -- cgit v1.2.3 From dce12a5ccff91bd2b985c9664ca29a4c1a083cf2 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 21 Mar 2023 09:58:45 -0700 Subject: pin code refactor --- src/components/Balance.svelte | 35 ++++++++---- src/components/Pin.svelte | 62 ++++++++++++++++------ src/components/Pinpad.svelte | 3 +- .../[username]/settings/[...tab]/+page.svelte | 7 +-- .../[username]/settings/[...tab]/_security.svelte | 6 +-- src/routes/(app)/login/+page.svelte | 8 +++ src/routes/(app)/payment/[id]/+page.svelte | 8 +-- src/routes/(app)/send/+layout.svelte | 21 +------- 8 files changed, 88 insertions(+), 62 deletions(-) (limited to 'src/components') diff --git a/src/components/Balance.svelte b/src/components/Balance.svelte index cc923b7d..fddaae3e 100644 --- a/src/components/Balance.svelte +++ b/src/components/Balance.svelte @@ -1,21 +1,34 @@ +{#if show && user.haspin && $pin?.length !== 6} + +{/if} +
-
- {#if isNaN($animatedRate)} -
—
- {:else} - {f((user.balance * $animatedRate) / sats, user.currency)} - {/if} -
+ {#if user.haspin && !$pin} + + {:else} +
+ {#if isNaN($animatedRate)} +
—
+ {:else} + {f((user.balance * $animatedRate) / sats, user.currency)} + {/if} +
-
- ⚡️{s(user.balance)} -
+
+ ⚡️{s(user.balance)} +
+ {/if}
diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte index 1d7ed65b..40a53b8b 100644 --- a/src/components/Pin.svelte +++ b/src/components/Pin.svelte @@ -1,31 +1,59 @@ -
-
-

{title}

- -
- +{#if loaded} +
+
+

{title}

+ +
+ +
-
+{/if} diff --git a/src/components/Pinpad.svelte b/src/components/Pinpad.svelte index bf3778f7..f55dc40d 100644 --- a/src/components/Pinpad.svelte +++ b/src/components/Pinpad.svelte @@ -1,7 +1,6 @@ -{#if loaded && user.haspin && $pin?.length !== 6} - +{#if user.haspin && $pin?.length !== 6} + {/if} {#if verifying} - + {:else if settingPin} - + {:else}
diff --git a/src/routes/(app)/login/+page.svelte b/src/routes/(app)/login/+page.svelte index 75998cd0..eb3ae26b 100644 --- a/src/routes/(app)/login/+page.svelte +++ b/src/routes/(app)/login/+page.svelte @@ -1,5 +1,13 @@ diff --git a/src/routes/(app)/payment/[id]/+page.svelte b/src/routes/(app)/payment/[id]/+page.svelte index 020efdbb..d3cc0b1b 100644 --- a/src/routes/(app)/payment/[id]/+page.svelte +++ b/src/routes/(app)/payment/[id]/+page.svelte @@ -113,9 +113,9 @@ {/if} {#if user.username.toLowerCase() === 'laughingbean'} - + {/if}
diff --git a/src/routes/(app)/send/+layout.svelte b/src/routes/(app)/send/+layout.svelte index e5c9c051..6192cd40 100644 --- a/src/routes/(app)/send/+layout.svelte +++ b/src/routes/(app)/send/+layout.svelte @@ -8,30 +8,11 @@ export let data; - let loaded; let { user } = data; - - onMount(() => setTimeout(() => (loaded = true), 500)); let cancel = () => goto(`/${user.username}`); - - $: browser && loaded && checkPin($pin); - let checkPin = async (p) => { - if (p?.length !== 6 || p === JSON.parse(sessionStorage.getItem('pin'))) return; - let result; - try { - result = await post('/pin', { pin: p }); - } catch (e) {} - - if (result) { - success('Pin confirmed'); - } else { - fail('Invalid pin'); - $pin = ''; - } - }; -{#if loaded && user.haspin && (!$pin || $pin?.length !== 6)} +{#if user.haspin && (!$pin || $pin?.length !== 6)} {/if} -- cgit v1.2.3 From aa258684dd8cf953afe540abb233ab0daad09253 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 22 Mar 2023 16:57:03 -0700 Subject: password reset --- src/components/Pin.svelte | 2 +- src/routes/(app)/[username]/generate/+server.js | 3 ++- src/routes/(app)/[username]/reset/+server.js | 10 ++++++++++ src/routes/(app)/admin/+page.svelte | 12 +++++++++++- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 src/routes/(app)/[username]/reset/+server.js (limited to 'src/components') diff --git a/src/components/Pin.svelte b/src/components/Pin.svelte index 40a53b8b..0cff904f 100644 --- a/src/components/Pin.svelte +++ b/src/components/Pin.svelte @@ -28,7 +28,7 @@ try { result = await post('/pin', { pin: p }); } catch (e) { - console.log('PIN ERR', e); + console.log('Pin check failed', e); } if (result) { diff --git a/src/routes/(app)/[username]/generate/+server.js b/src/routes/(app)/[username]/generate/+server.js index 1335c3e2..e1df08e3 100644 --- a/src/routes/(app)/[username]/generate/+server.js +++ b/src/routes/(app)/[username]/generate/+server.js @@ -3,7 +3,8 @@ import { error, json } from '@sveltejs/kit'; export async function POST({ cookies, request }) { try { - return json(await post(`/user`, await request.json(), auth(cookies))); + let body = await request.json(); + return json(await post(`/user`, body, auth(cookies))); } catch (e) { throw error(500, e.message); } diff --git a/src/routes/(app)/[username]/reset/+server.js b/src/routes/(app)/[username]/reset/+server.js new file mode 100644 index 00000000..73d3d849 --- /dev/null +++ b/src/routes/(app)/[username]/reset/+server.js @@ -0,0 +1,10 @@ +import { json } from '@sveltejs/kit'; +import { auth, post } from '$lib/utils'; + +export async function POST({ cookies, request, params }) { + let { username } = params; + let r = await request.json(); + let { password } = r; + let result = await post('/reset', { password, username }, auth(cookies)); + return json(result); +} diff --git a/src/routes/(app)/admin/+page.svelte b/src/routes/(app)/admin/+page.svelte index 011ed6a2..831b0284 100644 --- a/src/routes/(app)/admin/+page.svelte +++ b/src/routes/(app)/admin/+page.svelte @@ -1,12 +1,22 @@ {#each users as { balance, username, expected }} -
+
{username}
{balance}
{expected}
+
+
+ +
{/each} -- cgit v1.2.3 From f4507d0758c5e3e5e879d70cb1c5dbdbfd2186e8 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 29 Mar 2023 08:08:41 -0700 Subject: currency display --- src/components/Lnurlp.svelte | 6 ++++-- src/components/Lnurlw.svelte | 5 +++-- src/components/Numpad.svelte | 14 +++++++------- .../(app)/[username]/receive/[...param]/+page.svelte | 5 +++-- .../(app)/send/bitcoin/[address]/[...amount]/+page.svelte | 11 +++++++---- src/routes/(app)/send/lightning/[payreq]/+page.svelte | 5 +++-- src/routes/(app)/send/pot/[name]/[...amount]/+page.svelte | 5 ++++- .../(app)/send/user/[username]/[...amount]/+page.server.js | 5 +++-- .../(app)/send/user/[username]/[...amount]/+page.svelte | 8 ++++---- 9 files changed, 38 insertions(+), 26 deletions(-) (limited to 'src/components') diff --git a/src/components/Lnurlp.svelte b/src/components/Lnurlp.svelte index ab0c50ce..9918a3f4 100644 --- a/src/components/Lnurlp.svelte +++ b/src/components/Lnurlp.svelte @@ -6,7 +6,9 @@ export let data, form; let { currency } = data.user; - let { minSendable, maxSendable, callback, metadata } = data; + let { minSendable, maxSendable, callback, metadata, rates } = data; + + $: rate = rates[currency]; let amount = Math.round(minSendable / 1000), loading; @@ -33,7 +35,7 @@
{/if} - + diff --git a/src/components/Lnurlw.svelte b/src/components/Lnurlw.svelte index f2855b53..f780d755 100644 --- a/src/components/Lnurlw.svelte +++ b/src/components/Lnurlw.svelte @@ -7,7 +7,8 @@ export let data, form; let { currency, username } = data.user; - let { defaultDescription, minWithdrawable, maxWithdrawable, k1, callback } = data; + let { defaultDescription, minWithdrawable, maxWithdrawable, k1, callback, rates } = data; + $: rate = rates[currency]; let amount = Math.round(maxWithdrawable / 1000), loading; @@ -28,7 +29,7 @@
{/if} - + diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index 77a4f38b..20bfe561 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -7,17 +7,19 @@ export let amount, currency, fiat = !amount, + rate, submit = undefined; export let amountFiat = 0; + let arrow = '<'; $: update(amount, amountFiat); let update = (a, f) => { if (fiat) { - amount = Math.round(f / ($selectedRate / sats)); + amount = Math.round(f / (rate / sats)); } else { - amountFiat = ((a * $selectedRate) / sats).toFixed(2); + amountFiat = ((a * rate) / sats).toFixed(2); } }; @@ -60,7 +62,7 @@ amount = 0; } } - } else if (value !== '.' && value !== '<' && parseInt(amountFiat + value) > $selectedRate) { + } else if (value !== '.' && value !== '<' && parseInt(amountFiat + value) > rate) { warning($t('user.receive.lessThan1BTCWarning')); } else if (amountFiat !== 0 && amountFiat.match(/\.../)) { return; @@ -184,12 +186,10 @@ type="button" on:click={() => { if (fiat) { - amount = parseInt((amountFiat / ($selectedRate / sats)).toFixed(0)); + amount = parseInt((amountFiat / (rate / sats)).toFixed(0)); } else { amountFiat = - (amount * ($selectedRate / sats)).toFixed(2) > 0.0 - ? (amount * ($selectedRate / sats)).toFixed(2) - : 0; + (amount * (rate / sats)).toFixed(2) > 0.0 ? (amount * (rate / sats)).toFixed(2) : 0; } fiat = !fiat; }}> @@ -37,7 +38,7 @@
- +
{:else} - + {/if} diff --git a/src/routes/(app)/send/lightning/[payreq]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/+page.svelte index af07a565..cb1b539e 100644 --- a/src/routes/(app)/send/lightning/[payreq]/+page.svelte +++ b/src/routes/(app)/send/lightning/[payreq]/+page.svelte @@ -10,13 +10,14 @@ export let form; let { payreq } = $page.params; - let { alias } = data; + let { alias, rates } = data; let { currency } = data.user; let a; let maxfee = 100; $: amount = form?.amount || data.amount; + $: rate = rates[currency]; let loading; let submit = () => (loading = true); @@ -91,7 +92,7 @@ {:else} - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
1
- Bitcoin -
-
= {f(animatedRate, user.currency)}
-
-
-
-
⚡️{s((1 * sats) / animatedRate)} =
-
{f(1, user.currency)}
-
-
-
diff --git a/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js b/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js index 7cf87e14..04d413bb 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js +++ b/src/routes/(app)/[username]/invoice/[hash]/+layout.server.js @@ -12,10 +12,12 @@ export async function load({ depends, params, url, parent }) { if (user && invoice.uid !== user.id && !url.pathname.includes('tip')) throw redirect(307, `/send/invoice/${hash}`); - let { amount, received } = invoice; + let { amount, pending, received } = invoice; amount = parseInt(amount); - let paid = (!amount && received) || (amount > 0 && received >= amount); + console.log("PENDING", pending) + + let paid = (!amount && received) || (amount > 0 && (pending >= amount || received >= amount)); if (paid && !url.pathname.endsWith('paid')) throw redirect(307, `/${params.username}/invoice/${hash}/paid`); diff --git a/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte b/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte index 4d7aae51..c9619cee 100644 --- a/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte +++ b/src/routes/(app)/[username]/invoice/[hash]/paid/+page.svelte @@ -21,7 +21,7 @@ {#if received}

{$t('invoice.paymentSuccessful')}

- {f(fiat(received, rate), currency)} + {f(fiat(received - tip, rate), currency)} {#if tip} + {f(fiat(tip, rate), currency)} @@ -29,7 +29,7 @@ {/if}

- ⚡️{s(received)} + ⚡️{s(received - tip)} {#if tip} @@ -42,13 +42,13 @@ {#if pending}

Payment detected

- {f(fiat(pending, rate), currency)} + {f(fiat(pending - tip, rate), currency)} {#if tip} + {f(fiat(tip, rate), currency)} {/if}

- ⚡️{s(pending)} + ⚡️{s(pending - tip)} {#if tip} + ⚡️{s(tip)} diff --git a/src/routes/(app)/buy/+page.svelte b/src/routes/(app)/buy/+page.svelte index 2f556ada..22e7e9ec 100644 --- a/src/routes/(app)/buy/+page.svelte +++ b/src/routes/(app)/buy/+page.svelte @@ -1,7 +1,7 @@
@@ -141,7 +123,6 @@
1
Bitcoin
-
= {f($animatedRate, currency)}

3% credit card fee applies

diff --git a/src/routes/(app)/launch/purchase/+page.svelte b/src/routes/(app)/launch/purchase/+page.svelte index 3273752a..fbaa58c0 100644 --- a/src/routes/(app)/launch/purchase/+page.svelte +++ b/src/routes/(app)/launch/purchase/+page.svelte @@ -1,7 +1,6 @@ {#if need2fa} - + {/if}
-- cgit v1.2.3 From 404b390186b9786df598b8e2f9adc20fa8910040 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 13 Apr 2023 06:58:33 -0700 Subject: fix R$ symbol --- src/components/Numpad.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/Numpad.svelte b/src/components/Numpad.svelte index 82512678..5ea1418c 100644 --- a/src/components/Numpad.svelte +++ b/src/components/Numpad.svelte @@ -31,7 +31,7 @@ AUD: '$', NZD: '$', MXN: '$', - BRL: '$', + BRL: 'R$', HKD: '$', TWD: '$', JPY: '¥', -- cgit v1.2.3 From 7c967ae84b2f5620d3efed2ce1e93551ddbde04a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 13 Apr 2023 22:26:25 -0700 Subject: skip undefined locations --- src/components/LocationsMap.svelte | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/components') diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index 8a1b6afd..20ef8878 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -100,9 +100,7 @@ let markers = new MarkerClusterGroup(); locations.forEach((location) => { - if (location['deleted_at']) { - return; - } + if (location['deleted_at'] || !(location.lan && location.lon)) return; location = location['osm_json']; -- cgit v1.2.3 From 1cf10289b840d6fc56986d114fd762da75f4b103 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 13 Apr 2023 22:27:50 -0700 Subject: filter out payments with no lat/lon --- src/components/LocationsMap.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index 20ef8878..d84fa4ae 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -38,7 +38,7 @@ locations = locations.filter( (location) => - location['osm_json'].tags && location['osm_json'].tags['payment:coinos'] === 'yes' + location['osm_json'].tags && location['osm_json'].tags['payment:coinos'] === 'yes' && location.lat && location.lon ); /* const locations = [ -- cgit v1.2.3 From 9cce167a005d8261e4d5fbbcf0d97506a0ae8d5d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 13 Apr 2023 22:34:46 -0700 Subject: fix locations --- src/components/LocationsMap.svelte | 42 +++++--------------------------------- src/routes/+page.svelte | 7 +++++-- 2 files changed, 10 insertions(+), 39 deletions(-) (limited to 'src/components') diff --git a/src/components/LocationsMap.svelte b/src/components/LocationsMap.svelte index d84fa4ae..20eea6c0 100644 --- a/src/components/LocationsMap.svelte +++ b/src/components/LocationsMap.svelte @@ -38,43 +38,12 @@ locations = locations.filter( (location) => - location['osm_json'].tags && location['osm_json'].tags['payment:coinos'] === 'yes' && location.lat && location.lon + location['osm_json'].tags && + location['osm_json'].tags['payment:coinos'] === 'yes' && + location['osm_json'].lat && + location['osm_json'].lon ); - /* const locations = [ - { - lat: 49.27034, - lng: -123.141373, - info: 'Rolf Vancouver
1628 W 1st Ave #231, Vancouver
www.rolfbodywork.com' - }, - { lat: 49.26419, lng: -123.15702, info: 'Tacos Jorge
2287 W Broadway, Vancouver' }, - { - lat: 49.28273, - lng: -123.120735, - info: 'Engage Strategies
LinkedIn' - }, - { - lat: 49.28134, - lng: -123.02373, - info: 'Lumota Collection
Clothing Design/Upcycling - Appointment Only
778-726-3776
369 Boundary Rd, Vancouver, BC V5K 2B1
IG: Lumotacollection
FB: Lumotacollection' - }, - { - lat: 49.22643, - lng: -122.93085, - info: 'Goodwin Contracting
Project Management/Consulting - Appointment Only
403-812-1085
8017 17th Ave, Burnaby, BC V3N 1M5' - }, - { - lat: 51.04813, - lng: -114.07999, - info: 'Goodwin Contracting
Project Management/Consulting - Appointment Only
403-812-1085
8017 17th Ave, Burnaby, BC V3N 1M5' - }, - { - lat: 49.2677, - lng: -123.10124, - info: 'General Strike Coffee
Artisan coffee shop
1965 Main St, Vancouver, BC V5T 2K6
IG: generalstrikecoffee' - } - ];*/ - L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png', { maxZoom: 18, subdomains: ['a', 'b', 'c', 'd'] @@ -100,10 +69,9 @@ let markers = new MarkerClusterGroup(); locations.forEach((location) => { - if (location['deleted_at'] || !(location.lan && location.lon)) return; + if (location['deleted_at']) return; location = location['osm_json']; - let marker = L.marker([location.lat, location.lon]); marker.bindPopup( diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 2db2854a..2748e5c0 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -15,8 +15,11 @@ import { onMount } from 'svelte'; export let data; - let { user } = data; - let { locations } = data; + let { locations, user } = data; + let update = (data) => ({ locations, user } = data); + $: update(data); + + console.log(data, locations.length); let howItWorks; let faq; -- cgit v1.2.3