@internetarchive/ia-book-actions 0.0.29-alpha33 → 0.0.29-alpha35

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.0.29-alpha33",
3
+ "version": "0.0.29-alpha35",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@internetarchive/icon-info": "^1.2.6",
22
22
  "@internetarchive/local-cache": "^0.2.0",
23
- "@internetarchive/modal-manager": "^0.2.1",
23
+ "@internetarchive/modal-manager": "^0.2.6",
24
24
  "@internetarchive/shared-resize-observer": "^0.2.0",
25
25
  "@internetarchive/toast-manager": "0.0.1-alpha9",
26
26
  "lit": "^2.5.0"
@@ -51,7 +51,7 @@ export default class TimerCountdown extends LitElement {
51
51
  })
52
52
  );
53
53
  }
54
-
54
+ console.log(this.timeLeftOnLoan, this.loanRenewConfig.autoCheckAt)
55
55
  // clear interval if timer is < this.loanRenewConfig.autoCheckAt
56
56
  if (this.timeLeftOnLoan < this.loanRenewConfig.autoCheckAt) {
57
57
  clearInterval(this.timerInterval);
@@ -12,7 +12,7 @@ export class LoanTokenPoller {
12
12
  this.borrowType = borrowType;
13
13
  this.successCallback = successCallback; // callback function to be called after loan token is created
14
14
  this.errorCallback = errorCallback; // callback function to be called after loan token is created
15
- this.pollerDelay = pollerDelay; // value in ms (1000 ms = 1 sec)
15
+ this.pollerDelay = pollerDelay; // value in seconds
16
16
 
17
17
  this.loanTokenInterval = undefined;
18
18
  this.enableBookAccess();
@@ -57,7 +57,7 @@ export class LoanTokenPoller {
57
57
  if (this.borrowType !== 'adminBorrowed') {
58
58
  this.loanTokenInterval = setInterval(() => {
59
59
  this.handleLoanTokenPoller();
60
- }, this.pollerDelay);
60
+ }, this.pollerDelay * 1000);
61
61
  }
62
62
 
63
63
  // event category and action for browsing book access
@@ -350,6 +350,8 @@ export default class IABookActions extends LitElement {
350
350
  * Execute when loan is expired
351
351
  */
352
352
  async browseHasExpired() {
353
+ clearTimeout(this.browserTimer);
354
+
353
355
  const currStatus = { ...this.lendingStatus, browsingExpired: true };
354
356
  this.lendingStatus = currStatus;
355
357