window.rentappActivity = { lastActivity: Date.now(), init: function () { const update = () => { this.lastActivity = Date.now(); }; ['mousedown', 'keydown', 'touchstart', 'scroll', 'click', 'pointerdown'] .forEach(evt => document.addEventListener(evt, update, true)); }, idleMinutes: function () { return (Date.now() - this.lastActivity) / 1000 / 60; } }; window.rentappActivity.init(); // При закрытии вкладки — сбрасываем токен window.addEventListener('beforeunload', function () { localStorage.removeItem('rentapp_token'); localStorage.removeItem('rentapp_user'); });
An unhandled error has occurred.
Reload
🗙