Angular4 with @ng2-idle trying to capture the inactivity of the user.
code example link https://hackedbychinese.github.io/ng2-idle/
I am trying to customize it so every time user goes idle i show modal with ok button. and user will able to resume only ok is clicked on the modal.
on page load default interrupts are on
idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);
on idleStart i show my modal and count down begins
on onIdleEnd i close my modal
when modal is open i want to disable DEFAULT_INTERRUPTSOURCES only manual interrupt so i called idle.clearInterrupts() and on modal ok press event calling idle.interrupt(true);
once modal is close i set idle.setInterrupts(DEFAULT_INTERRUPTSOURCES); again.
does not seems to work very well. after modal close and open again it does not car about DEFAULT_INTERRUPTSOURCES and on setIdle time it goes automiticaly idle mode even though user interacts with the UI.