2022-09-01 11:00:49 +00:00
|
|
|
import PersistenceRegistry from '../base/redux/PersistenceRegistry';
|
|
|
|
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
2019-09-19 13:28:57 +00:00
|
|
|
|
|
|
|
import { SET_SCREENSHOT_CAPTURE } from './actionTypes';
|
|
|
|
|
|
|
|
PersistenceRegistry.register('features/screnshot-capture', true, {
|
|
|
|
capturesEnabled: false
|
|
|
|
});
|
|
|
|
|
2022-01-21 10:25:23 +00:00
|
|
|
const DEFAULT_STATE = {
|
|
|
|
capturesEnabled: false
|
|
|
|
};
|
|
|
|
|
2022-09-01 11:00:49 +00:00
|
|
|
export interface IScreenshotCaptureState {
|
|
|
|
capturesEnabled: boolean;
|
|
|
|
}
|
|
|
|
|
2022-09-05 09:05:07 +00:00
|
|
|
ReducerRegistry.register<IScreenshotCaptureState>('features/screenshot-capture',
|
|
|
|
(state = DEFAULT_STATE, action): IScreenshotCaptureState => {
|
2019-09-19 13:28:57 +00:00
|
|
|
switch (action.type) {
|
|
|
|
case SET_SCREENSHOT_CAPTURE: {
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
capturesEnabled: action.payload
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|