problem: build fails (memory leak)

This commit is contained in:
gsovereignty
2024-08-17 15:29:44 +08:00
parent 396db9595f
commit 85bd3ca18c
6 changed files with 19 additions and 40 deletions

View File

@@ -2,17 +2,16 @@
import * as Card from '@/components/ui/card';
import * as Table from '@/components/ui/table';
import { Rocket, ZapPurchase } from '@/event_helpers/rockets';
import { ndk } from '@/ndk';
import { Avatar, Name } from '@nostr-dev-kit/ndk-svelte-components';
import { writable } from 'svelte/store';
import Pie from './Pie.svelte';
import { Avatar, Name } from '@nostr-dev-kit/ndk-svelte-components';
import { ndk } from '@/ndk';
import NumberIncrement from '@components/ui/number-increment';
import NumberIncrement from './NumberIncrement.svelte';
export let rocket: Rocket;
export let unratifiedZaps: Map<string, ZapPurchase>;
let unratifiedZapsAmount = 0;
let dataLoaded = false;
$: {
unratifiedZapsAmount = 0;
@@ -55,7 +54,6 @@
}
merits.set(_merits);
dataLoaded = true;
}
const COLORS = [

View File

@@ -1,11 +1,11 @@
<script lang="ts">
import { onMount } from 'svelte';
import { cubicOut } from 'svelte/easing';
import { expoInOut } from 'svelte/easing';
import { tweened } from 'svelte/motion';
export let targetValue: number;
export let targetValue: number = 0;
let currentValue = tweened(0, { duration: 1000, easing: cubicOut });
let currentValue = tweened(0, { duration: 1000, easing: expoInOut });
// Re-trigger animation whenever targetValue changes
$: if (targetValue !== undefined && targetValue !== null) {
@@ -18,11 +18,3 @@
</script>
<span class="merits">{$currentValue.toFixed(0)}</span>
<style>
.merits {
transition:
transform 0.5s ease-in-out,
opacity 0.5s ease-in-out;
}
</style>

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { Button, buttonVariants } from '$lib/components/ui/button/index.js';
import { Button } from '$lib/components/ui/button/index.js';
import * as Dialog from '$lib/components/ui/dialog/index.js';
import { Input } from '$lib/components/ui/input';
import * as Alert from '@/components/ui/alert';
@@ -8,9 +8,7 @@
import { ndk } from '@/ndk';
import { currentUser } from '@/stores/session';
import { NDKZap } from '@nostr-dev-kit/ndk';
import { Spinner } from 'flowbite-svelte';
import { CheckCircleOutline } from 'flowbite-svelte-icons';
import { Terminal } from 'lucide-svelte';
import { Check, Terminal } from 'lucide-svelte';
import { cubicOut } from 'svelte/easing';
import { tweened } from 'svelte/motion';
import { requestProvider } from 'webln';
@@ -37,7 +35,7 @@
});
invoice = await z.createZapRequest(
rocketProduct.Price() * 1000,
`Purchase of ${product.Name()} from ${rocket.Event.dTag}`,
`Purchase of ${product.Name()} from ${rocket.Name()}`,
[['product', product.ID()]]
);
}
@@ -85,7 +83,7 @@
<Dialog.Trigger>
<Button {disabled}>
{#if open}
<Spinner class="me-2" color="white" size={4} /> Confirming...
Confirming...
{:else if !disabled}
Buy Now for {formatSats(rocketProduct.Price())}
{:else if disabled}
@@ -121,10 +119,10 @@
<Button on:click={payWithWebLn}>
{#if paymentFinished}
<div style="transform: scale({$scale});">
<CheckCircleOutline class="me-2 text-white" color="white" />
<Check class="me-2 text-white" color="white" />
</div>
{:else if paymentInitiated}
<Spinner class="me-2" color="white" size={4} /> Confirming payment...
Confirming payment...
{:else}
Pay with WebLN
{/if}

View File

@@ -1,3 +0,0 @@
import NumberIncrement from './number-increment.svelte';
export default NumberIncrement;