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:

  1. open https://sizzling-fire-7471.firebaseapp.com/ , click faq page link @ bottom . see list of q & a
  2. then click left arrow on top go main page
  3. 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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -