@internetarchive/ia-book-actions 0.1.11-b4 → 0.1.11-b5

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": "@internetarchive/ia-book-actions",
3
- "version": "0.1.11-b4",
3
+ "version": "0.1.11-b5",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -534,10 +534,11 @@ export default class IABookActions extends LitElement {
534
534
  if (!timerCountdown) return;
535
535
 
536
536
  const secondsLeft = Number.parseInt((Number(this.lendingStatus.secondsLeftOnLoan)), 10);
537
- const strokeDashOffset = Number.parseInt(((secondsLeft / this.loanRenewTimeConfig.loanTotalTime) * 315) * 1.5, 10);
537
+ const firstStrokeDashOffset = Number.parseInt(((secondsLeft / this.loanRenewTimeConfig.loanTotalTime) * 315) * 1.5, 10);
538
+ const actualStrokeDashOffset = firstStrokeDashOffset > 315 ? 315 : firstStrokeDashOffset;
538
539
 
539
540
 
540
- console.log('resetTimerCountState === ', { secondsLeft, strokeDashOffset });
541
+ console.log('resetTimerCountState === ', { secondsLeft, firstStrokeDashOffset, actualStrokeDashOffset});
541
542
 
542
543
  // set seconds left in loan expire
543
544
  timerCountdown.style?.setProperty('--secondsLeftOnLoan', `${secondsLeft}s`);
@@ -545,7 +546,7 @@ export default class IABookActions extends LitElement {
545
546
  // set circle stroke offset left in loan expire
546
547
  timerCountdown.style?.setProperty(
547
548
  '--strokeLeftOnLoan',
548
- `${strokeDashOffset}` // the perimeter of the circle = (π * 2 * radius)
549
+ `${actualStrokeDashOffset}` // the perimeter of the circle = (π * 2 * radius)
549
550
  );
550
551
 
551
552
  const animationCircle = timerCountdown.shadowRoot.querySelector('.circle');