2022-09-01 14:00:49 +03:00
|
|
|
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
|
|
|
|
import { set } from '../base/redux/functions';
|
2019-07-23 21:56:05 +01:00
|
|
|
|
|
|
|
|
import { SET_CURRENT_NOTIFICATION_UID } from './actionTypes';
|
|
|
|
|
|
2022-09-01 14:00:49 +03:00
|
|
|
export interface ITalkWhileMutedState {
|
2022-10-28 09:41:12 +03:00
|
|
|
currentNotificationUid?: string;
|
2022-09-01 14:00:49 +03:00
|
|
|
}
|
|
|
|
|
|
2019-07-23 21:56:05 +01:00
|
|
|
/**
|
|
|
|
|
* Reduces the redux actions of the feature talk while muted.
|
|
|
|
|
*/
|
2022-09-05 12:05:07 +03:00
|
|
|
ReducerRegistry.register<ITalkWhileMutedState>('features/talk-while-muted',
|
|
|
|
|
(state = {}, action): ITalkWhileMutedState => {
|
2019-07-23 21:56:05 +01:00
|
|
|
switch (action.type) {
|
|
|
|
|
case SET_CURRENT_NOTIFICATION_UID:
|
|
|
|
|
return set(state, 'currentNotificationUid', action.uid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return state;
|
|
|
|
|
});
|