I need this to save AJAX requests for 24 hours for the pixabay API. When the user searches manually I want to check in the locally stored requests if he did this the last 24hours. So I want to check the key without providing anything in data at this time.
I managed to get it work like this, but it would be nice if it would be a property:
<app-indexeddb-mirror ... load-from-cache-when-data-empty="true"></app-indexeddb-mirror>
Changing to:
if (this.online && this.data.length != 0) {
and:
|
if (this.online || !this.client.supportsMirroring) { |
to:
if ((this.online & this.data.length != 0) || !this.client.supportsMirroring) {
solves it for me.
Maybe this can be enhanced as a feature for the element?
Load cached data if offline OR no data available in "live-data"?
I need this to save AJAX requests for 24 hours for the pixabay API. When the user searches manually I want to check in the locally stored requests if he did this the last 24hours. So I want to check the key without providing anything in data at this time.
I managed to get it work like this, but it would be nice if it would be a property:
<app-indexeddb-mirror ... load-from-cache-when-data-empty="true"></app-indexeddb-mirror>app-storage/app-indexeddb-mirror/app-indexeddb-mirror.html
Line 240 in 191e31d
Changing to:
if (this.online && this.data.length != 0) {and:
app-storage/app-indexeddb-mirror/app-indexeddb-mirror.html
Line 248 in 191e31d
to:
if ((this.online & this.data.length != 0) || !this.client.supportsMirroring) {solves it for me.
Maybe this can be enhanced as a feature for the element?
Load cached data if offline OR no data available in "live-data"?