ref(shared-video) Merge web and native reducers (#12108)

Convert reducer to TS
pull/12101/head
Robert Pintilii 3 years ago committed by GitHub
parent 575ab1f1cb
commit cfda02ee10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      react/features/app/reducers.any.js
  2. 1
      react/features/app/reducers.native.js
  3. 1
      react/features/app/reducers.web.js
  4. 2
      react/features/app/types.ts
  5. 31
      react/features/shared-video/reducer.native.js
  6. 22
      react/features/shared-video/reducer.ts

@ -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…
Cancel
Save