Issue with showing content from Firebase using Google Polymer Firebase element -
i have faq page reads firebase node , lists q & contents using below lines of code:
<firebase-auth id="fblogin" provider="anonymous" location="https://xxx.firebaseio.com"></firebase-auth> <firebase-collection orderbypriority log id="fbfaq" location="https://xxx.firebaseio.com/faq" data="{{faqs}}"></firebase-collection> <template is="dom-repeat" items="[[faqs]]" as="faq"> <div class="forborder"> <akyral-details id="[[faq.__firebasekey__]]"> <akyral-summary>[[faq.q]]</akyral-summary> <p class="answer">[[faq.a]]</p> </akyral-details> </div> </template>
i have link mainpage faq page , upon click works perfect! when go main page , click again faq link page renders nothing. if refresh page fine.
to recreate following:
- open https://sizzling-fire-7471.firebaseapp.com/ , click faq page link @ bottom . see list of q & a
- then click left arrow on top go main page
- now click faq link again , not see anything,but in console see fetching data. also, refreshing page makes okay
i bet it's race condition. firebase-auth
, firebase-collection
firing @ same time, causing try fetch collection before it's authorized. try wrapping firebase-collection
in <template is="dom-if" if="{{fbuser}}">
doesn't stamped until auth completed.
Comments
Post a Comment