From f28e5e226578afafa95f76dd080795928092d12f Mon Sep 17 00:00:00 2001 From: midblep Date: Wed, 25 May 2022 00:36:13 +0200 Subject: [PATCH] clone function cus why not --- src/lib/calculator/Calculator.svelte | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/calculator/Calculator.svelte b/src/lib/calculator/Calculator.svelte index e268dd5..05d355b 100644 --- a/src/lib/calculator/Calculator.svelte +++ b/src/lib/calculator/Calculator.svelte @@ -164,6 +164,14 @@ save(); } + function copy(commission: Commission) { + let newCommission = { ...commission }; + newCommission.name = "Commission " + number; + commissions.push(newCommission); + commissions = commissions; + save(); + } + function remove(name: string) { commissions = commissions.filter(value => { return value.name != name; @@ -192,7 +200,7 @@
- +
@@ -240,6 +248,7 @@

{commission.name}

${commission.price}

+