@internetarchive/ia-book-actions 0.0.29-alpha32 → 0.0.29-alpha33
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
|
@@ -123,14 +123,16 @@
|
|
|
123
123
|
iaBookActions.bwbPurchaseUrl = '';
|
|
124
124
|
iaBookActions.modalConfig = modalConfig;
|
|
125
125
|
iaBookActions.lendingBarPostInit = lendingBarPostInit;
|
|
126
|
-
iaBookActions.tokenDelay =
|
|
126
|
+
iaBookActions.tokenDelay = 2; // 2 seconds
|
|
127
127
|
iaBookActions.returnUrl = 'https://openlibrary.org';
|
|
128
128
|
iaBookActions.localCache = localCache;
|
|
129
|
+
|
|
130
|
+
let isDevBox = true;
|
|
129
131
|
iaBookActions.loanRenewConfig = {
|
|
130
|
-
totalTime:
|
|
131
|
-
autoCheckAt:
|
|
132
|
-
pageChangedInLast:
|
|
133
|
-
env: 'dev'
|
|
132
|
+
totalTime: isDevBox ? 120 : 3600, // 60 second = 1 min
|
|
133
|
+
autoCheckAt: isDevBox ? 115 : 3540, // at last 10th minute
|
|
134
|
+
pageChangedInLast: isDevBox ? 80 : 900, // within last 15 second/minute
|
|
135
|
+
env: isDevBox ? 'dev' : 'prod',
|
|
134
136
|
};
|
|
135
137
|
|
|
136
138
|
let lendingStatus1 = iaBookActions.lendingStatus;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ import * as Cookies from '../doc-cookies.js';
|
|
|
15
15
|
export default class ActionsHandler extends LitElement {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
|
-
this.ajaxTimeout =
|
|
18
|
+
this.ajaxTimeout = 6; // in seconds
|
|
19
19
|
|
|
20
20
|
this.bindEvents();
|
|
21
21
|
}
|
|
@@ -262,7 +262,7 @@ export default class ActionsHandler extends LitElement {
|
|
|
262
262
|
// redirection on details page after 5 seconds because borrowing book takes time to create item creation.
|
|
263
263
|
setTimeout(() => {
|
|
264
264
|
URLHelper.goToUrl(redirectTo, true);
|
|
265
|
-
}, this.ajaxTimeout);
|
|
265
|
+
}, this.ajaxTimeout * 1000);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
// save consecutive loan count for borrow
|
package/src/ia-book-actions.js
CHANGED
|
@@ -60,7 +60,7 @@ export default class IABookActions extends LitElement {
|
|
|
60
60
|
this.sharedObserver = undefined;
|
|
61
61
|
this.disableActionGroup = false;
|
|
62
62
|
this.modal = undefined;
|
|
63
|
-
this.tokenDelay =
|
|
63
|
+
this.tokenDelay = 120; // in seconds
|
|
64
64
|
|
|
65
65
|
// private props
|
|
66
66
|
this.primaryActions = [];
|
|
@@ -225,7 +225,7 @@ export default class IABookActions extends LitElement {
|
|
|
225
225
|
this.resetTimerCountState();
|
|
226
226
|
}
|
|
227
227
|
},
|
|
228
|
-
this.loanRenewResult.renewNow ? this.tokenDelay : 100
|
|
228
|
+
this.loanRenewResult.renewNow ? this.tokenDelay * 1000 : 100
|
|
229
229
|
);
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -341,10 +341,9 @@ export default class IABookActions extends LitElement {
|
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
const timeLeft = secondsLeftOnLoan * 1000;
|
|
345
344
|
this.browserTimer = setTimeout(() => {
|
|
346
345
|
this.browseHasExpired();
|
|
347
|
-
},
|
|
346
|
+
}, secondsLeftOnLoan * 1000);
|
|
348
347
|
}
|
|
349
348
|
|
|
350
349
|
/**
|
|
@@ -497,7 +496,7 @@ export default class IABookActions extends LitElement {
|
|
|
497
496
|
this.borrowType,
|
|
498
497
|
successCallback,
|
|
499
498
|
errorCallback,
|
|
500
|
-
this.tokenDelay //
|
|
499
|
+
this.tokenDelay // in seconds
|
|
501
500
|
);
|
|
502
501
|
}
|
|
503
502
|
|