22.01.2026, 07:49
It won't work because certain variables (currentPlanId) and functions (showPlan) are not defined in trends.
Try this for trends and schedulers. Adjust timeout value and location as needed.
Try this for trends and schedulers. Adjust timeout value and location as needed.
Code:
$(function() {
var body = $('body')
var timeout = 90 // seconds
if (body.hasClass('trends') || body.hasClass('schedulers')) {
var events = ['pointermove', 'keydown', 'click', 'scroll']
var ticks = 0
function reset() {
ticks = 0
}
events.forEach(function(event) {
document.addEventListener(event, reset, true)
})
setInterval(function() {
ticks++
if (ticks >= timeout) {
window.location = '/apps/'
}
}, 1000)
}
})