@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:
|
|
135
|
-
let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast:
|
|
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 =
|
|
138
|
+
iaBookActions.loanRenewTimeConfig = loanTotalTime5Min;
|
|
139
139
|
|
|
140
140
|
let lendingStatus1 = iaBookActions.lendingStatus;
|
|
141
141
|
let secondsLeftOnLoan = iaBookActions.loanRenewTimeConfig.loanTotalTime;
|
package/package.json
CHANGED
|
@@ -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 <=
|
|
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
|
}
|
package/src/ia-book-actions.js
CHANGED
|
@@ -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;
|