2022-07-27 13:28:10 +03:00
|
|
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes';
|
|
|
|
|
import ReducerRegistry from '../redux/ReducerRegistry';
|
2019-07-10 04:02:27 -07:00
|
|
|
|
2019-07-13 06:59:58 -07:00
|
|
|
import { USER_INTERACTION_RECEIVED } from './actionTypes';
|
2019-07-10 04:02:27 -07:00
|
|
|
|
2022-07-27 13:28:10 +03:00
|
|
|
export interface IUserInteractionState {
|
|
|
|
|
interacted?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2022-09-05 12:05:07 +03:00
|
|
|
ReducerRegistry.register<IUserInteractionState>('features/base/user-interaction',
|
|
|
|
|
(state = {}, action): IUserInteractionState => {
|
2019-07-10 04:02:27 -07:00
|
|
|
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;
|
|
|
|
|
});
|