loadData ({ state, dispatch }, isForced = false) {
    // console.log('Action: Check data', { isForced })
    const lastLoad = get(state, KEY_DATE, null)
    // Is the last loading time longer ago than one day ago or has been loaded before at all
    const shouldReload = isTooOld(lastLoad)
    // Check current data object
    const currentData = get(state, ['data', 'length'], 0)
    // If longer ago, empty or forced (on hard reload)
    const willReload = (shouldReload || !currentData) ? true : isForced
    // if (willReload) {
    //   console.log('Data is too old or reload is forced. Will reload data')
    // }
    // The authorization is called in any case but with varying parameter. The follower is the function called afterwards
    dispatch('auth/auth', { follower: { name: 'load/load' }, isForced: willReload }, { root: true })
  }
// This only checks how old the current data from the local storage is
This only checks how old the current data from the local storage is
This only checks how old the current data from the local storage is
loadData ({ state, dispatch }, isForced = false) {
    const lastLoad = get(state, KEY_DATE, null)
    const shouldReload = isTooOld(lastLoad)
    const currentData = get(state, ['data', 'length'], 0)
    const willReload = (shouldReload || !currentData) ? true : isForced
    dispatch('auth/auth', { follower: { name: 'load/load' }, isForced: willReload }, { root: true })
  }
loadData ( { state , dispatch } , isForced = false ) { const lastLoad = get ( state , KEY_DATE , null ) const shouldReload = isTooOld ( lastLoad ) const currentData = get ( state , [ 'data' , 'length' ] , 0 ) const willReload = ( shouldReload || ! currentData ) ? true : isForced dispatch ( 'auth/auth' , { follower : { name : 'load/load' } , isForced : willReload } , { root : true } ) }
This only checks how old the current data from the local storage is
This only checks how old the current data from the local storage is
// console.log('Action: Check data', { isForced }) // Is the last loading time longer ago than one day ago or has been loaded before at all // Check current data object // If longer ago, empty or forced (on hard reload) // if (willReload) { //   console.log('Data is too old or reload is forced. Will reload data') // } // The authorization is called in any case but with varying parameter. The follower is the function called afterwards