|
Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT SERVER-PC 10.0 build 26200 (Windows 11) AMD64 User : ServerPC ( 0) PHP Version : 8.2.12 Disable Function : NONE Directory : C:/Users/ServerPC/AppData/Roaming/Emby-Server/system/dashboard-ui/modules/common/ |
Upload File : |
define(["exports","./servicelocator.js","./../emby-apiclient/events.js"],function(_exports,_servicelocator,_events){function onInterval(){this._lastInterval=Date.now();var options=this.options;options&&options.onInterval()}function MethodTimer(options){this.options=options,this.boundOnAppResume=function(){var options,started=this.isStarted();this.stopInterval(),started&&((started=this._lastInterval)&&(options=this.options)&&started+options.timeoutMs<=Date.now()&&onInterval.call(this),this.startInterval())}.bind(this),this.boundOnInterval=onInterval.bind(this),_events.default.on(_servicelocator.appHost,"resume",this.boundOnAppResume),this.startInterval()}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,MethodTimer.prototype.stopInterval=function(){this._interval&&(("interval"===this._intervalType?clearInterval:clearTimeout)(this._interval),this._interval=null,this._intervalType=null)},MethodTimer.prototype.startInterval=function(){this._lastInterval=Date.now(),"interval"===this.options.type?(this._interval=setInterval(this.boundOnInterval,this.options.timeoutMs),this._intervalType="interval"):this._interval=setTimeout(this.boundOnInterval,this.options.timeoutMs)},MethodTimer.prototype.isStarted=function(){return null!=this._interval},MethodTimer.prototype.destroy=function(){this.options=null,this.boundOnAppResume&&(_events.default.off(_servicelocator.appHost,"resume",this.boundOnAppResume),this.boundOnAppResume=null),this.stopInterval(),this.boundOnInterval=null,this._lastInterval=null};_exports.default=MethodTimer});