ref(shared-video) Merge web and native reducers (#12108)
Convert reducer to TS
This commit is contained in:
parent
575ab1f1cb
commit
cfda02ee10
|
@ -48,6 +48,7 @@ import '../recent-list/reducer';
|
|||
import '../recording/reducer';
|
||||
import '../settings/reducer';
|
||||
import '../speaker-stats/reducer';
|
||||
import '../shared-video/reducer';
|
||||
import '../subtitles/reducer';
|
||||
import '../screen-share/reducer';
|
||||
import '../toolbox/reducer';
|
||||
|
|
|
@ -6,7 +6,6 @@ import '../mobile/call-integration/reducer';
|
|||
import '../mobile/external-api/reducer';
|
||||
import '../mobile/full-screen/reducer';
|
||||
import '../mobile/watchos/reducer';
|
||||
import '../shared-video/reducer';
|
||||
|
||||
import './reducer.native';
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import '../remote-control/reducer';
|
|||
import '../screen-share/reducer';
|
||||
import '../noise-suppression/reducer';
|
||||
import '../screenshot-capture/reducer';
|
||||
import '../shared-video/reducer';
|
||||
import '../talk-while-muted/reducer';
|
||||
import '../virtual-background/reducer';
|
||||
import './reducers.any';
|
||||
|
|
|
@ -54,6 +54,7 @@ import { IPollsState } from '../polls/reducer';
|
|||
import { IPowerMonitorState } from '../power-monitor/reducer';
|
||||
import { IPrejoinState } from '../prejoin/reducer';
|
||||
import { IReactionsState } from '../reactions/reducer';
|
||||
import { ISharedVideoState } from '../shared-video/reducer';
|
||||
|
||||
export interface IStore {
|
||||
dispatch: Function,
|
||||
|
@ -119,5 +120,6 @@ export interface IState {
|
|||
'features/power-monitor': IPowerMonitorState,
|
||||
'features/prejoin': IPrejoinState,
|
||||
'features/reactions': IReactionsState,
|
||||
'features/shared-video': ISharedVideoState,
|
||||
'features/testing': ITestingState
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
// @flow
|
||||
|
||||
import { ReducerRegistry } from '../base/redux';
|
||||
|
||||
import { RESET_SHARED_VIDEO_STATUS, SET_SHARED_VIDEO_STATUS } from './actionTypes';
|
||||
|
||||
const initialState = {};
|
||||
|
||||
/**
|
||||
* Reduces the Redux actions of the feature features/shared-video.
|
||||
*/
|
||||
ReducerRegistry.register('features/shared-video', (state = initialState, action) => {
|
||||
const { videoUrl, status, time, ownerId, muted, volume } = action;
|
||||
|
||||
switch (action.type) {
|
||||
case RESET_SHARED_VIDEO_STATUS:
|
||||
return initialState;
|
||||
case SET_SHARED_VIDEO_STATUS:
|
||||
return {
|
||||
...state,
|
||||
muted,
|
||||
ownerId,
|
||||
status,
|
||||
time,
|
||||
videoUrl,
|
||||
volume
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
});
|
|
@ -1,16 +1,25 @@
|
|||
// @flow
|
||||
|
||||
import { ReducerRegistry } from '../base/redux';
|
||||
import ReducerRegistry from '../base/redux/ReducerRegistry';
|
||||
|
||||
import { RESET_SHARED_VIDEO_STATUS, SET_SHARED_VIDEO_STATUS, SET_DISABLE_BUTTON } from './actionTypes';
|
||||
|
||||
const initialState = {};
|
||||
|
||||
export interface ISharedVideoState {
|
||||
disabled?: boolean;
|
||||
muted?: boolean;
|
||||
ownerId?: string;
|
||||
status?: string;
|
||||
time?: number;
|
||||
videoUrl?: string;
|
||||
volume?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces the Redux actions of the feature features/shared-video.
|
||||
*/
|
||||
ReducerRegistry.register('features/shared-video', (state = initialState, action) => {
|
||||
const { videoUrl, status, time, ownerId, disabled, muted } = action;
|
||||
ReducerRegistry.register('features/shared-video',
|
||||
(state: ISharedVideoState = initialState, action): ISharedVideoState => {
|
||||
const { videoUrl, status, time, ownerId, disabled, muted, volume } = action;
|
||||
|
||||
switch (action.type) {
|
||||
case RESET_SHARED_VIDEO_STATUS:
|
||||
|
@ -22,7 +31,8 @@ ReducerRegistry.register('features/shared-video', (state = initialState, action)
|
|||
ownerId,
|
||||
status,
|
||||
time,
|
||||
videoUrl
|
||||
videoUrl,
|
||||
volume
|
||||
};
|
||||
|
||||
case SET_DISABLE_BUTTON:
|
Loading…
Reference in New Issue