@internetarchive/ia-book-actions 0.1.11-b47 → 0.1.11-b49

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-b47",
3
+ "version": "0.1.11-b49",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -83,7 +83,6 @@ export default class IABookActions extends LitElement {
83
83
 
84
84
  // private props
85
85
  this.postInitComplete = false;
86
- this.loanTokenPollerStarted = false;
87
86
  this.primaryActions = [];
88
87
  this.primaryTitle = '';
89
88
  this.primaryColor = 'primary';
@@ -158,6 +157,11 @@ export default class IABookActions extends LitElement {
158
157
  this.disconnectResizeObserver();
159
158
  this.setupResizeObserver();
160
159
  }
160
+
161
+ if (changed.has('loanRenewResult') && this.loanRenewResult.renewNow) {
162
+ log("UPDATED --- loanRenewResult.renewNow is true, clearing intervals");
163
+ window.IALendingIntervals.clearAll();
164
+ }
161
165
  }
162
166
 
163
167
  /** SharedObserver resize handler */
@@ -650,7 +654,7 @@ export default class IABookActions extends LitElement {
650
654
  */
651
655
  async handleLoanAutoRenewed(event) {
652
656
  if (this.loanRenewResult.renewNow) {
653
- window?.IALendingIntervals?.clearAll();
657
+ // window?.IALendingIntervals?.clearAll();
654
658
 
655
659
  // Now, let's reset loan duration & this.lendingStatus
656
660
  const loanTime = await this.localCache.get(`${this.identifier}-loanTime`);
@@ -882,7 +886,6 @@ export default class IABookActions extends LitElement {
882
886
  this.showErrorModal(errorMsg, action);
883
887
 
884
888
  // if error related to loan token
885
- // - clear tokenPoller interval
886
889
  // - set user_has_browsed to `false`
887
890
  if (action === 'create_token') {
888
891
  const currStatus = {