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