title: Logout error with conditional collection on React Firebase app
body: <p>On my Navbar.js component I have a conditional element that only displays if you are an siteAdministrator. If the condition is met you are shown the link and you can navigate to the page. However, when I logout I get thrown an error:</p>
  
  <blockquote>
    <p>Uncaught FirebaseError: Function Query.where() requires a valid third
    argument, but it was undefined.</p>
  </blockquote>
  
  <p>What I think is happening is that the system is logging out the user and while the rest of code in export default is finishing it is noticing that props.auth.uid does not exists. Are there any other thoughts as to what is happening and could someone help me fix it. Thanks in advance...</p>
  
  <pre><code>// SiteAdministrators.js Component showing database query
  const mapStateToProps = (state) =&gt; {
    const auth = state.firebase.auth
  
    return {
      messages: state.firestore.ordered.messages,
      siteAdmin: state.firestore.ordered.siteAdministrators,
      auth: auth
    }
  }
  
  export default compose(
    connect(mapStateToProps),
    firestoreConnect(props =&gt; {
      return [
          { collection: 'messages', where: [['replied', '==', false]] },
          { collection: 'siteAdministrators', where: [['pilotId', '==', props.auth.uid]]}
        ]
    })
  )(SiteAdministrator);
  
  // NavbarLinks.js Component showing logout function
  const mapDispatchToProps = (dispatch) =&gt; {
    return {
      logout: () =&gt; dispatch(logout())
    }
  }
  
  export default compose(
    connect(mapStateToProps, mapDispatchToProps),
    firestoreConnect(props =&gt; {
      return [
          { collection: 'siteAdministrators' }
        ]
    })
  )(LoggedInLinks)
  </code></pre>