@internetarchive/ia-book-actions 0.1.4-alpha4 → 0.1.4-alpha5

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/demo/index.html CHANGED
@@ -131,11 +131,11 @@
131
131
  iaBookActions.returnUrl = 'https://openlibrary.org';
132
132
  iaBookActions.localCache = localCache;
133
133
 
134
- let loanTotalTime2Min = { loanTotalTime: 300, loanRenewAtLast: 120, pageChangedInLast: 60 };
135
- let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast: 180, pageChangedInLast: 15 };
134
+ let loanTotalTime2Min = { loanTotalTime: 20, loanRenewAtLast: 15, pageChangedInLast: 5 };
135
+ let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast: 290, pageChangedInLast: 15 };
136
136
  let loanTotalTime1Hour = { loanTotalTime: 3600, loanRenewAtLast: 600, pageChangedInLast: 900 };
137
137
 
138
- iaBookActions.loanRenewTimeConfig = loanTotalTime2Min;
138
+ iaBookActions.loanRenewTimeConfig = loanTotalTime5Min;
139
139
 
140
140
  let lendingStatus1 = iaBookActions.lendingStatus;
141
141
  let secondsLeftOnLoan = iaBookActions.loanRenewTimeConfig.loanTotalTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-book-actions",
3
- "version": "0.1.4-alpha4",
3
+ "version": "0.1.4-alpha5",
4
4
  "description": "Bookreader actions for borrowable book",
5
5
  "author": "Internet Archive",
6
6
  "license": "AGPL-3.0-only",
@@ -89,8 +89,8 @@ export default class TimerCountdown extends LitElement {
89
89
  this.dispatchLoanRenewEvent(secondsLeft);
90
90
  }
91
91
 
92
- // clear interval
93
- if (secondsLeft <= 10) {
92
+ // clear interval in secondsLeft if less
93
+ if (secondsLeft <= this.timerExecutionSeconds) {
94
94
  this.disconnectedCallback();
95
95
  window?.Sentry?.captureMessage(sentryLogs.clearOneHourTimer);
96
96
  }
@@ -260,11 +260,10 @@ export default class IABookActions extends LitElement {
260
260
  * dispatched this event from bookreader page changed
261
261
  */
262
262
  window.addEventListener('BookReader:userAction', () => {
263
+ this.suppressToast = true;
264
+
263
265
  if (this.borrowType === 'browsed') {
264
- this.suppressToast = false;
265
266
  this.autoLoanRenewChecker(true);
266
- } else {
267
- this.suppressToast = true;
268
267
  }
269
268
 
270
269
  return nothing;