@internetarchive/ia-book-actions 1.1.0-alpha11 → 1.1.0-alpha13
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 +1 -1
- package/package.json +1 -1
- package/src/ia-book-actions.js +7 -3
package/demo/index.html
CHANGED
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
iaBookActions.returnUrl = '';
|
|
132
132
|
iaBookActions.localCache = localCache;
|
|
133
133
|
|
|
134
|
-
let loanTotalTime2Min = { loanTotalTime:
|
|
134
|
+
let loanTotalTime2Min = { loanTotalTime: 65, loanRenewAtLast: 60, pageChangedInLast: 15 };
|
|
135
135
|
let loanTotalTime5Min = { loanTotalTime: 300, loanRenewAtLast: 180, pageChangedInLast: 15 };
|
|
136
136
|
let loanTotalTime1Hour = { loanTotalTime: 3600, loanRenewAtLast: 660, pageChangedInLast: 900 };
|
|
137
137
|
|
package/package.json
CHANGED
package/src/ia-book-actions.js
CHANGED
|
@@ -89,7 +89,7 @@ export default class IABookActions extends LitElement {
|
|
|
89
89
|
this.lendingOptions = {};
|
|
90
90
|
this.borrowType = null; // 'browsed'|'borrowed'
|
|
91
91
|
this.browseTimer = undefined; // timeout
|
|
92
|
-
this.timerExecutionSeconds =
|
|
92
|
+
this.timerExecutionSeconds = 10;
|
|
93
93
|
|
|
94
94
|
/** @deprecated */
|
|
95
95
|
this.toast = undefined;
|
|
@@ -133,7 +133,9 @@ export default class IABookActions extends LitElement {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
sentryCaptureMsg(msg) {
|
|
136
|
-
|
|
136
|
+
log(window?.Sentry);
|
|
137
|
+
log(window?.Sentry?.captureMessage(msg));
|
|
138
|
+
if (window?.Sentry) window?.Sentry?.captureMessage(msg);
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
firstUpdated() {
|
|
@@ -289,7 +291,8 @@ export default class IABookActions extends LitElement {
|
|
|
289
291
|
|
|
290
292
|
/**
|
|
291
293
|
* auto-renew interval may stale when tab is in background,
|
|
292
|
-
*
|
|
294
|
+
* when user jump on the books tab,
|
|
295
|
+
* the [visibilitychange] event can trigger timer to show relavent messages
|
|
293
296
|
*/
|
|
294
297
|
document.addEventListener("visibilitychange", async () => {
|
|
295
298
|
if (!document.hidden) {
|
|
@@ -301,6 +304,7 @@ export default class IABookActions extends LitElement {
|
|
|
301
304
|
if (secondsLeft >= this.timerExecutionSeconds) {
|
|
302
305
|
this.setIntervalExecutionBlock(Number(secondsLeft));
|
|
303
306
|
} else {
|
|
307
|
+
this.browseHasExpired();
|
|
304
308
|
this.disconnectedCallback();
|
|
305
309
|
}
|
|
306
310
|
}
|