@internetarchive/ia-book-actions 0.1.11-b59 → 0.1.11-b60

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-b59",
3
+ "version": "0.1.11-b60",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -63,15 +63,16 @@ export class CollapsibleActionGroup extends ActionsHandler {
63
63
  this.resetActions();
64
64
  }
65
65
 
66
- if (changed.has('autoRenew') && this.autoRenew === true) {
66
+ if (changed.has('autoRenew') && this.autoRenew) {
67
67
  this.dispatchLoanEvent('autoRenew');
68
68
  }
69
-
70
- if (changed.has('autoReturn') && this.autoReturn === true) {
69
+
70
+ const requestingAutoreturn = changed.has('autoReturn') && this.autoReturn;
71
+ if (requestingAutoreturn) {
71
72
  this.dispatchLoanEvent('autoReturn');
72
73
  }
73
74
 
74
- if (changed.has('returnNow') && this.returnNow === true) {
75
+ if (changed.has('returnNow') && this.returnNow && !requestingAutoreturn) {
75
76
  this.dispatchLoanEvent('returnNow', { borrowType: 'browse' });
76
77
  }
77
78
  }
@@ -552,7 +552,7 @@ export default class IABookActions extends LitElement {
552
552
  }
553
553
 
554
554
  async startBrowseTimer() {
555
- window.IALendingIntervals.clearBrowseExpireTimeout();
555
+ window?.IALendingIntervals?.clearBrowseExpireTimeout();
556
556
 
557
557
  const {
558
558
  browsingExpired,