async function handleDatabaseLoading () {
    let showingLoadingMessage = false
    const timeoutHandle = setTimeout(() => {
      showingLoadingMessage = true
      message = i18n.loadingMessage
    }, TIMEOUT_BEFORE_LOADING_MESSAGE)
    try {
      await database.ready()
      databaseLoaded = true // eslint-disable-line no-unused-vars
    } catch (err) {
      logError(err)
      message = i18n.networkErrorMessage
    } finally {
      clearTimeout(timeoutHandle)
      if (showingLoadingMessage) { // Seems safer than checking the i18n string, which may change
        showingLoadingMessage = false
        message = '' // eslint-disable-line no-unused-vars
      }
    }
  }
// show a Loading message if it takes a long time, or show an error if there's a network/IDB error
show a Loading message if it takes a long time, or show an error if there's a network/IDB error
show a Loading message if it takes a long time or show an error if there ' s a network / IDB error
async function handleDatabaseLoading () {
    let showingLoadingMessage = false
    const timeoutHandle = setTimeout(() => {
      showingLoadingMessage = true
      message = i18n.loadingMessage
    }, TIMEOUT_BEFORE_LOADING_MESSAGE)
    try {
      await database.ready()
      databaseLoaded = true 
    } catch (err) {
      logError(err)
      message = i18n.networkErrorMessage
    } finally {
      clearTimeout(timeoutHandle)
      if (showingLoadingMessage) { 
        showingLoadingMessage = false
        message = '' 
      }
    }
  }
async function handleDatabaseLoading ( ) { let showingLoadingMessage = false const timeoutHandle = setTimeout ( ( ) => { showingLoadingMessage = true message = i18n . loadingMessage } , TIMEOUT_BEFORE_LOADING_MESSAGE ) try { await database . ready ( ) databaseLoaded = true } catch ( err ) { logError ( err ) message = i18n . networkErrorMessage } finally { clearTimeout ( timeoutHandle ) if ( showingLoadingMessage ) { showingLoadingMessage = false message = '' } } }
show a Loading message if it takes a long time, or show an error if there's a network/IDB error
show a Loading message if it takes a long time or show an error if there ' s a network / IDB error
// eslint-disable-line no-unused-vars // Seems safer than checking the i18n string, which may change // eslint-disable-line no-unused-vars