How to use the cozy-client.hasQueryBeenLoaded function in cozy-client

To help you get started, we’ve selected a few cozy-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy.github.io / en / cozy-banks / src / ducks / settings / DelayedDebitAlert.jsx View on Github external
render() {
    const { doc, onToggle, onChangeDoc, accountsById, accounts, t } = this.props

    if (!hasQueryBeenLoaded(accounts)) {
      return 
    }

    const value = doc.value

    const docCreditCardAccount = doc.creditCardAccount
      ? accountsById[doc.creditCardAccount._id]
      : null
    const docCheckingsAccount = doc.checkingsAccount
      ? accountsById[doc.checkingsAccount._id]
      : null

    const creditCardAccount =
      docCreditCardAccount || this.getCreditCardDefaultValue()
    const checkingsAccount =
      docCheckingsAccount || this.getCheckingsDefaultValue()