@internetarchive/ia-book-actions 0.0.29-alpha17 → 0.0.29-alpha18
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 +6 -5
package/package.json
CHANGED
package/src/ia-book-actions.js
CHANGED
|
@@ -152,12 +152,12 @@ export default class IABookActions extends LitElement {
|
|
|
152
152
|
return nothing;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
showToastMessage() {
|
|
155
|
+
async showToastMessage() {
|
|
156
156
|
let toastManager = document.querySelector('toast-template');
|
|
157
157
|
if (!toastManager) {
|
|
158
158
|
toastManager = document.createElement('toast-template');
|
|
159
159
|
}
|
|
160
|
-
document.body.appendChild(toastManager);
|
|
160
|
+
await document.body.appendChild(toastManager);
|
|
161
161
|
|
|
162
162
|
toastManager.config = new ToastConfig(this.loanRenewResult);
|
|
163
163
|
}
|
|
@@ -165,16 +165,17 @@ export default class IABookActions extends LitElement {
|
|
|
165
165
|
async browseHasExpired() {
|
|
166
166
|
const currStatus = { ...this.lendingStatus, browsingExpired: true };
|
|
167
167
|
this.lendingStatus = currStatus;
|
|
168
|
-
this.loanRenewResult.renewNow = false;
|
|
169
168
|
|
|
170
169
|
// remove respected key:value
|
|
171
170
|
await this.localCache.delete(`${this.identifier}-loanTime`);
|
|
172
171
|
await this.localCache.delete(`${this.identifier}-pageChangedTime`);
|
|
173
172
|
|
|
174
173
|
// show message after browsed book is expired.
|
|
174
|
+
this.loanRenewResult.renewNow = false;
|
|
175
175
|
this.loanRenewResult.texts =
|
|
176
176
|
'This book has been auto-returned due to inactivity.';
|
|
177
|
-
|
|
177
|
+
|
|
178
|
+
this.showToastMessage();
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
async browseHasRenew() {
|
|
@@ -528,7 +529,7 @@ export default class IABookActions extends LitElement {
|
|
|
528
529
|
}
|
|
529
530
|
|
|
530
531
|
toast-template {
|
|
531
|
-
--toastHeightFromTop:
|
|
532
|
+
--toastHeightFromTop: 15%;
|
|
532
533
|
--toastBGColor: #333333;
|
|
533
534
|
--toastFontColor: #ffffff;
|
|
534
535
|
}
|