moribvndvs / ng2-idle

Responding to idle users in Angular (not AngularJS) applications.
https://moribvndvs.github.io/ng2-idle
Apache License 2.0
322 stars 129 forks source link

Interrupt sources for Angular Electron application #152

Closed mathudak closed 3 years ago

mathudak commented 3 years ago

Interrupt source are ignored/not working in the Electron application. When the application is running in the Web Browser, ng2-idle is working as supposed to. But when the application is built as Electron application no interrupt happens and user is logged out even without any means of stopping it.

How to specify interrupts for the Electron application Is there a way to specify my own interrupt source with shell/window or whatever the target provided by ElectronService?

What I tried

    new DocumentInterruptSource(
      'mousemove keydown DOMMouseScroll mousewheel mousedown touchstart touchmove scroll',
      {
        // no idea what to put here, looks like a bad choice for me
      }
    );

Also tried to create it manually but again, no idea what to put there

    const electronSource: InterruptSource = {
      attach: () => {},
      detach: () => {},
      isAttached: true,
      onInterrupt: EventEmitter<>
    };

Additional context Great project to quick start the Electron Angular application if someone's interested in trying it

mathudak commented 3 years ago

Issue is caused by trying to change the interrupt settings without app reload