Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Error: Cannot read property 'getTime' of null #54

Closed
MarbleDaemon opened this issue May 30, 2017 · 1 comment
Closed

Type Error: Cannot read property 'getTime' of null #54

MarbleDaemon opened this issue May 30, 2017 · 1 comment
Assignees
Labels

Comments

@MarbleDaemon
Copy link

MarbleDaemon commented May 30, 2017

I'm submitting a ... (check one with "x")

[ x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help

Current behavior

When Idle start: onIdleStart:

core.es5.js:1084 ERROR TypeError: Cannot read property 'getTime' of null
at watchFn (idle.js:202)
at ZoneDelegate.webpackJsonp.1271.ZoneDelegate.invokeTask (zone.js:424)
at Object.onInvokeTask (core.es5.js:4140)
at ZoneDelegate.webpackJsonp.1271.ZoneDelegate.invokeTask (zone.js:423)
at Zone.webpackJsonp.1271.Zone.runTask (zone.js:191)
at ZoneTask.invoke (zone.js:486)
at timer (zone.js:1512)

Expected behavior

Subscription to onIdleStart should be triggered.

Minimal reproduction of the problem with instructions

This is the method used in AppComponent

constructor(private idle: Idle) {
   this.setupIdle();
}

 private setupIdle() {
    this.idle.setIdle(20);

    this.idle.onIdleStart.subscribe(() => {
        ....
    });

    this.resetIdle();
  }

private resetIdle() {
    this.idle.watch(true);
  }

What is the motivation / use case for changing the behavior?

Auto logout when user idle

Please tell us about your environment:

Windows 10, IntelliJ IDEA, NPM, Node.js

  • @ng-idle version: 2.x

"@ng-idle/core": "^2.0.0-beta.11"

  • Angular version: 2.x

"@angular/core": "^4.1.1"

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Chrome 58.0.3029.110

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    TypeScript

  • Node: node --version =
    v6.10.3

@grbsk grbsk self-assigned this May 30, 2017
@grbsk grbsk added the bug label May 30, 2017
@grbsk grbsk closed this as completed in 06fcb36 May 30, 2017
@grbsk
Copy link
Owner

grbsk commented May 30, 2017

Thanks, this is fixed in beta.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants