@internetarchive/ia-book-actions 1.1.0-alpha13 → 1.1.0-alpha14
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 +1 -1
- package/src/ia-book-actions.js +10 -8
package/package.json
CHANGED
package/src/ia-book-actions.js
CHANGED
|
@@ -298,14 +298,16 @@ export default class IABookActions extends LitElement {
|
|
|
298
298
|
if (!document.hidden) {
|
|
299
299
|
log('visibilitychange is not hidden time: ------------------ ', new Date().getMinutes(), new Date().getSeconds());
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
this.
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
301
|
+
if (this.borrowType === 'browsed' && this.lendingStatus.browsingExpired === false) {
|
|
302
|
+
const loanTime = await this.localCache.get(`${this.identifier}-loanTime`);
|
|
303
|
+
const secondsLeft = Math.round((loanTime - new Date()) / 1000); // different in seconds
|
|
304
|
+
|
|
305
|
+
if (secondsLeft >= this.timerExecutionSeconds) {
|
|
306
|
+
this.setIntervalExecutionBlock(Number(secondsLeft));
|
|
307
|
+
} else {
|
|
308
|
+
this.browseHasExpired();
|
|
309
|
+
this.disconnectedCallback();
|
|
310
|
+
}
|
|
309
311
|
}
|
|
310
312
|
}
|
|
311
313
|
});
|