-
Notifications
You must be signed in to change notification settings - Fork 9
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
Uncaught (in promise) Error: idle status delay must be a number type for idleStatus === 'AWAY' #15
Comments
Oh, I see, you do not use redux-thunk package, instead redux-middleware is your own library, which also provides a thunk component. Nevertheless, I changed store configuration exactly like in your example but don't get it running:
Can you help out? What wrong here? |
Can you modify your export const idleStatusDelay = idleStatus => (dispatch, getState) => {
const exp_delta = getExpirationDelta();
if(typeof exp_delta !== "number")
throw new Error("exp_delta must be a number, received: " + typeof exp_delta);
if(idleStatus === IDLESTATUS_AWAY)
return 20000;
if(idleStatus === IDLESTATUS_INACTIVE)
return exp_delta;
if(idleStatus === IDLESTATUS_EXPIRED)
return exp_delta + 1000; // Log them out after another minute after they enter the inactive status
throw new Error("Unhandled status type: " + idleStatus);
}; |
Hi, export const idleStatusDelay = idleStatus => () => {
if(idleStatus === IDLESTATUS_AWAY)
return 20000;
if(idleStatus === IDLESTATUS_INACTIVE)
return 60000;
if(idleStatus === IDLESTATUS_EXPIRED)
return 120000;
}; Still I have these errors, always:
which in your code (middleware.js) happens here: var scheduleTransition = function scheduleTransition(idleStatus) {
clearTimeout(nextTimeoutID);
var delay = dispatch(idleStatusDelay(idleStatus));
(0, _invariant2.default)(delay, 'must return an idle status delay for idleStatus === \'' + idleStatus + '\'');
(0, _invariant2.default)(typeof delay === 'number', 'idle status delay must be a number type for idleStatus === \'' + idleStatus + '\''); And the system does not get idle. Never :-( |
@oliverbienert sorry for slow replies, it's a busy week. I believe that error should only occur if your I believe either throwing an error when the
|
Hi,
I setup redux-idle-monitor as described in the readme. When running it, the above error appears in the console.
With developer tools I digged into this:
However, the returned type is a Promise, not a number. What's wrong here? My action looks:
Also store configuration is as you described:
The text was updated successfully, but these errors were encountered: