@everymatrix/player-rglimits 1.29.5 → 1.29.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/player-rglimits",
3
- "version": "1.29.5",
3
+ "version": "1.29.7",
4
4
  "main": "index.js",
5
5
  "svelte": "src/index.ts",
6
6
  "scripts": {
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "f2e3f1edbe2a15979fd224f987ea52d179bb95f0"
38
+ "gitHead": "6774dd803fe9ab951334d05d7f0ec99f78b6c0a0"
39
39
  }
@@ -137,7 +137,8 @@
137
137
  selectedProduct = productList[0];
138
138
  }
139
139
 
140
- getLimitBalanceById(limitDefinitionList[0]);
140
+ const limit = limitDefinitionList.find( (item) => item.period === selectedLimitPeriod ) || limitDefinitionList[0] ;
141
+ getLimitBalanceById(limit);
141
142
  } catch ( err ) {
142
143
  isLoading = false;
143
144
  handleError($_('fetchLimitBalanceError'));
@@ -318,20 +319,16 @@
318
319
  * @param limit - The limit information to calculate the gauge value.
319
320
  */
320
321
  const setGauge = (limit:DisplayedLimit):void => {
321
- const newGaugeValue = (180 / limit.totalAmount) * parseFloat(limit.spentAmount);
322
+ // Calculate newGaugeValue within [0, 180]
323
+ let newGaugeValue = (180 / limit.totalAmount) * parseFloat(limit.spentAmount);
324
+ newGaugeValue = Math.min(180, Math.max(0, newGaugeValue));
325
+
322
326
  const step = 1.5; // Step size for increasing/decreasing gaugeValue
323
327
  const interval = setInterval(() => {
324
- if (Math.abs(gaugeValue - newGaugeValue) < step) {
325
- gaugeValue = newGaugeValue;
326
- clearInterval(interval);
327
- } else {
328
- gaugeValue += (gaugeValue < newGaugeValue) ? step : -step;
329
- }
328
+ gaugeValue += (gaugeValue < newGaugeValue) ? step : -step;
330
329
 
331
- // Boundary checks to ensure gaugeValue stays within [0, 180]
332
- gaugeValue = Math.min(180, Math.max(0, gaugeValue));
333
-
334
- if (gaugeValue === newGaugeValue) {
330
+ if (Math.abs(gaugeValue - newGaugeValue) <= step) {
331
+ gaugeValue = newGaugeValue;
335
332
  clearInterval(interval);
336
333
  }
337
334
  });
@@ -882,7 +879,7 @@
882
879
 
883
880
  .GaugeFill {
884
881
  --p:0deg;
885
- --b:25px;
882
+ --b:26px;
886
883
  border-radius:500px 500px 0 0;
887
884
  background: $primary-gauge-fill-color;
888
885
  mask: radial-gradient(farthest-side at bottom,transparent calc(100% - var(--b) - 1px),#fff calc(100% - var(--b))), linear-gradient(var(--p),#fff 50%,transparent 0) top/100% 200%;