aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/invoice
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/(app)/invoice')
-rw-r--r--src/routes/(app)/invoice/[id]/+layout.server.ts1
-rw-r--r--src/routes/(app)/invoice/[id]/+page.svelte8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/routes/(app)/invoice/[id]/+layout.server.ts b/src/routes/(app)/invoice/[id]/+layout.server.ts
index ab41dddc..a18dad4e 100644
--- a/src/routes/(app)/invoice/[id]/+layout.server.ts
+++ b/src/routes/(app)/invoice/[id]/+layout.server.ts
@@ -11,6 +11,7 @@ export async function load({ cookies, depends, params, url, parent }) {
if (id) {
invoice = await get(`/invoice/${id}`);
+ console.log("INV", invoice);
const options = !!url.searchParams.get("options");
let { amount, pending, received } = invoice;
amount = parseInt(amount);
diff --git a/src/routes/(app)/invoice/[id]/+page.svelte b/src/routes/(app)/invoice/[id]/+page.svelte
index 29dd815d..30fa3dce 100644
--- a/src/routes/(app)/invoice/[id]/+page.svelte
+++ b/src/routes/(app)/invoice/[id]/+page.svelte
@@ -1,4 +1,5 @@
<script>
+ import { getWallet } from "$lib/ark";
import { enhance } from "$app/forms";
import { send } from "$lib/socket";
import {
@@ -8,6 +9,7 @@
copy,
f,
fail,
+ success,
get,
types,
sat,
@@ -97,6 +99,12 @@
if (typeof newAmount !== "undefined") invoice.amount = newAmount;
invoice.address_type = address_type;
invoice.type = type;
+
+ if (type === "ark") {
+ const wallet = await getWallet();
+ invoice.hash = await wallet.getAddress();
+ }
+
await update();
}
settingType = false;