From 77dd08bd6e290bc3f54cc058bdc018ff404e2b5c Mon Sep 17 00:00:00 2001 From: Mitchell Kotler Date: Wed, 29 Nov 2023 12:50:23 -0500 Subject: [PATCH] use credit cost for premium addons if it is set to more than 1 --- src/addons/dispatch/Premium.svelte | 9 +++++---- src/addons/dispatch/stories/Premium.stories.svelte | 8 ++++++++ src/addons/fixtures/addons.json | 7 ++++--- src/langs/json/en.json | 4 +++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/addons/dispatch/Premium.svelte b/src/addons/dispatch/Premium.svelte index b289fd01d..a8e03d702 100644 --- a/src/addons/dispatch/Premium.svelte +++ b/src/addons/dispatch/Premium.svelte @@ -28,8 +28,7 @@ $: isIndividualOrg = typeof user?.organization !== "string" && user?.organization?.individual; $: isPremium = addon?.parameters?.categories?.includes("premium") ?? false; - const { amount, unit } = addon?.parameters?.cost ?? {}; - $: prettyCost = amount && unit ? handlePlural(amount, unit) : null; + const { amount, unit, cost } = addon?.parameters?.cost ?? {}; function toggleSpendingLimit( event: Event & { currentTarget: HTMLInputElement }, @@ -151,9 +150,11 @@ {$_("addonDispatchDialog.premium")}
- {#if prettyCost} + {#if amount}

- {prettyCost} per credit + {$_("addonDispatchDialog.cost", { + values: { amount: amount, unit: unit, cost: cost || 1}, + })}

{/if}