src/views/Blocks/Userscript.js
// check if cached block HTML is newer than cache_timeout
check if cached block HTML is newer than cache_timeout
check if cached block HTML is newer than cache_timeout
useCache() {
    const timeout = this.props.block.cache_timeout
    if (! timeout)
      return false
    if (! this.props.cache)
      return false
    const last_update_at = this.props.cache.at
    if (! last_update_at)
      return false
    const now = new Date().getTime()
    const update_after = (parseInt(last_update_at, 10) + parseInt(timeout, 10))
    return now < update_after
  }
useCache ( ) { const timeout = this . props . block . cache_timeout if ( ! timeout ) return false if ( ! this . props . cache ) return false const last_update_at = this . props . cache . at if ( ! last_update_at ) return false const now = new Date ( ) . getTime ( ) const update_after = ( parseInt ( last_update_at , 10 ) + parseInt ( timeout , 10 ) ) return now < update_after }
check if cached block HTML is newer than cache_timeout
check if cached block HTML is newer than cache_timeout
// this.log("check cache timeout", this.props.block, this.props.cache) // this.log("CHECK NOW", new Date(now), "<", new Date(update_after))