Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple <app-indexeddb-mirror> not working when offline #90

Open
8ctopotamus opened this issue Jan 28, 2017 · 0 comments
Open

Multiple <app-indexeddb-mirror> not working when offline #90

8ctopotamus opened this issue Jan 28, 2017 · 0 comments

Comments

@8ctopotamus
Copy link

8ctopotamus commented Jan 28, 2017

I have two <app-indexeddb-mirror>s loading responses from two different <iron-ajax> calls. Both seem to work fine in build/bundled, until I take the app offline in dev tools or disconnect from WiFi.

Then only one of the dom-repeats, populated by its respective <app-indexddb-mirror>, renders on the page when I turn the network off, even though I can see the data from both responses in Dev Tools > Application > IndexDB.

<iron-ajax
      id="userData"
      url="api-url/users"
      handle-as="json"
      last-response="{{response_user}}"
      on-response="getUserDataComplete">
</iron-ajax>

<iron-ajax
      id="podcastData"
      url="api-url/podcasts"
      handle-as="json"
      last-response="{{response_podcasts}}"
      on-response="getPodcastDataComplete">
</iron-ajax>

<app-indexeddb-mirror
    key="userData"
    data="{{response_user}}"
    persisted-data="{{persistedUserData}}">
</app-indexeddb-mirror>

<app-indexeddb-mirror
     key="podcastData"
     data="{{response_podcasts}}"
     persisted-data="{{persistedPodcastData}}">
</app-indexeddb-mirror>

<!-- only this dom-repeat works in build/bundled when "offline" -->
<template is="dom-repeat" items="{{persistedUserData}}" as="user">
     <div>[[user.name]]</div>
     <div>[[user.slug]]</div>
</template>

<template is="dom-repeat" items="{{persistedPodcastData}}" as="podcast">
     <div>[[podcast.title.rendered]]</div>
     <audio src="[[podcast.acf.podcast_file]]" controls></audio>
</template>

Values in Dev Tools > Application > IndexDB:
key                      value
"userData"          Array[1]
"podcastData"    Array[10]

Any ideas as to why only one of the dom-repeats is rendering when offline?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant