2019-07-10 11:02:27 +00:00
|
|
|
// @flow
|
|
|
|
|
2020-05-20 10:57:03 +00:00
|
|
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
|
2019-07-10 11:02:27 +00:00
|
|
|
import { ReducerRegistry } from '../redux';
|
|
|
|
|
2019-07-13 13:59:58 +00:00
|
|
|
import { USER_INTERACTION_RECEIVED } from './actionTypes';
|
2019-07-10 11:02:27 +00:00
|
|
|
|
|
|
|
ReducerRegistry.register('features/base/user-interaction', (state = {}, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case APP_WILL_MOUNT:
|
2019-07-13 13:59:58 +00:00
|
|
|
case APP_WILL_UNMOUNT:
|
2019-07-10 11:02:27 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
interacted: false
|
|
|
|
};
|
|
|
|
|
|
|
|
case USER_INTERACTION_RECEIVED:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
interacted: true
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|