kupos-ui-components-lib 9.6.1 → 9.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -282,12 +282,14 @@ const commonService = {
282
282
  return { originalPrice: price, discountedPrice: price };
283
283
  }
284
284
  const { discount_type, discount_value, max_discount } = serviceItem;
285
+ const fixedDiscount = discount_type === "fixed" && discount_value != null ? discount_value : 0;
285
286
  const percentageDiscount = discount_type === "percentage" && discount_value != null
286
287
  ? (price * discount_value) / 100
287
288
  : 0;
289
+ const rawDiscount = fixedDiscount || percentageDiscount;
288
290
  const finalDiscount = max_discount != null && max_discount > 0
289
- ? Math.min(percentageDiscount, max_discount)
290
- : percentageDiscount;
291
+ ? Math.min(rawDiscount, max_discount)
292
+ : rawDiscount;
291
293
  const discountedPrice = Math.max(0, price - finalDiscount);
292
294
  return { originalPrice: price, discountedPrice };
293
295
  },
@@ -312,6 +314,9 @@ const commonService = {
312
314
  startCountdown: (node, countdownSeconds = 599) => {
313
315
  if (!node)
314
316
  return;
317
+ if (node.dataset.timerStarted)
318
+ return;
319
+ node.dataset.timerStarted = "true";
315
320
  const prevId = node.dataset.countdownId;
316
321
  if (prevId)
317
322
  clearInterval(Number(prevId));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "9.6.1",
3
+ "version": "9.6.3",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"