@internetarchive/ia-book-actions 0.0.29-alpha6 → 0.0.29-alpha8
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
CHANGED
|
@@ -27,7 +27,7 @@ export class OneHourAutoRenew {
|
|
|
27
27
|
|
|
28
28
|
// private props
|
|
29
29
|
this.resultRes = {
|
|
30
|
-
toastTexts:
|
|
30
|
+
toastTexts: '',
|
|
31
31
|
hideToast: true,
|
|
32
32
|
renewNow: false,
|
|
33
33
|
browseAgainNow: false,
|
|
@@ -36,7 +36,7 @@ export class OneHourAutoRenew {
|
|
|
36
36
|
return this.handleBookAutoRenew();
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
handleBookAutoRenew() {
|
|
40
40
|
try {
|
|
41
41
|
// if page is not clicked in last 15 minutes,
|
|
42
42
|
// instantaly renew it if user viewed new page in last 10 minutes
|
|
@@ -84,8 +84,6 @@ export class OneHourAutoRenew {
|
|
|
84
84
|
this.resultRes.browseAgainNow = true;
|
|
85
85
|
|
|
86
86
|
this.setNewBrowseTime();
|
|
87
|
-
} else {
|
|
88
|
-
console.log("can't autorenew this time!");
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
this.setPageFlippedTime();
|
package/src/ia-book-actions.js
CHANGED
|
@@ -117,6 +117,9 @@ export default class IABookActions extends LitElement {
|
|
|
117
117
|
this.addEventListener('autoRenewAttempt', async event => {
|
|
118
118
|
const isPageClick = event.detail.bookPageChange;
|
|
119
119
|
|
|
120
|
+
// early return if user is not browsed book
|
|
121
|
+
if (isPageClick && this.borrowType !== 'browsed') return nothing;
|
|
122
|
+
|
|
120
123
|
this.autoRenewRes = await new OneHourAutoRenew(
|
|
121
124
|
isPageClick,
|
|
122
125
|
this.identifier,
|
|
@@ -133,8 +136,9 @@ export default class IABookActions extends LitElement {
|
|
|
133
136
|
|
|
134
137
|
if (this.browseAgainNow) {
|
|
135
138
|
await this.browseHasRenew();
|
|
136
|
-
// this.resetTimerCountdown = true;
|
|
137
139
|
}
|
|
140
|
+
|
|
141
|
+
return nothing;
|
|
138
142
|
});
|
|
139
143
|
}
|
|
140
144
|
|
|
@@ -315,7 +319,7 @@ export default class IABookActions extends LitElement {
|
|
|
315
319
|
|
|
316
320
|
get bookActionBar() {
|
|
317
321
|
return html`
|
|
318
|
-
<button @click=${() => this.pageFlipEvent}>Page Flip</button>
|
|
322
|
+
<button @click=${() => this.pageFlipEvent()}>Page Flip</button>
|
|
319
323
|
<collapsible-action-group
|
|
320
324
|
.userid=${this.userid}
|
|
321
325
|
.identifier=${this.identifier}
|
|
@@ -515,7 +519,7 @@ export default class IABookActions extends LitElement {
|
|
|
515
519
|
}
|
|
516
520
|
|
|
517
521
|
toast-message {
|
|
518
|
-
--messageHeightFromTop:
|
|
522
|
+
--messageHeightFromTop: 17%;
|
|
519
523
|
}
|
|
520
524
|
`;
|
|
521
525
|
}
|