FirebaseExtended / polymerfire

Polymer Web Components for Firebase
https://www.webcomponents.org/element/firebase/polymerfire
MIT License
459 stars 142 forks source link

Viewing data when offline #181

Open Tevinthuku opened 7 years ago

Tevinthuku commented 7 years ago

Description

Ive looked at the note app demo and when the app is ofline it still shows the firebase data that was present My app only shows data when app is online but never when offline

  <firebase-auth
    id="authentication"
    user="{{user}}"></firebase-auth>

  <!--the category query  ->
  <firebase-query
    id="query"
    path="/category"
    data="{{viewcategory}}">
  </firebase-query>

  <!--LOCAL STORAGE OF THE DATA IN THE PATH-->
  <app-indexeddb-mirror
      session="[[user.uid]]"
      key="viewcategory"
      data="{{viewcategory}}"
      persisted-data="{{localcategories}}">
  </app-indexeddb-mirror>

 <template is="dom-repeat" items="[[localcategories]]" strip-whitespace>
      <li>[[localcategories.name]]</li>
 </template>

Expected outcome

When Offline Im still supposed to see the data of the localcategories.

Actual outcome

I only see the loader which I set up but when online everything is okay

Live Demo

Steps to reproduce

Browsers Affected

tjmonsi commented 7 years ago

This is kinda disconcerting actually. Sometimes app-indexeddb-mirror works. Other times it doesn't. Might be Service worker's config but I can't figure it out yet as well.

artemik commented 7 years ago

Any fix?

nidelson commented 6 years ago

If app-indexeddb-mirror really worked, it would be one of the best and most used.

tjmonsi commented 6 years ago

I haven't tried using pouch-db as an alternative but I might look into it in my future projects