snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
36
react/features/mobile/audio-mode/reducer.ts
Normal file
36
react/features/mobile/audio-mode/reducer.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import ReducerRegistry from '../../base/redux/ReducerRegistry';
|
||||
import { equals, set } from '../../base/redux/functions';
|
||||
|
||||
import { _SET_AUDIOMODE_DEVICES, _SET_AUDIOMODE_SUBSCRIPTIONS } from './actionTypes';
|
||||
import { IRawDevice } from './components/AudioRoutePickerDialog';
|
||||
|
||||
export interface IMobileAudioModeState {
|
||||
devices: IRawDevice[];
|
||||
subscriptions: {
|
||||
remove: Function;
|
||||
}[];
|
||||
}
|
||||
|
||||
const DEFAULT_STATE = {
|
||||
devices: [],
|
||||
subscriptions: []
|
||||
};
|
||||
|
||||
ReducerRegistry.register<IMobileAudioModeState>('features/mobile/audio-mode',
|
||||
(state = DEFAULT_STATE, action): IMobileAudioModeState => {
|
||||
switch (action.type) {
|
||||
case _SET_AUDIOMODE_DEVICES: {
|
||||
const { devices } = action;
|
||||
|
||||
if (equals(state.devices, devices)) {
|
||||
return state;
|
||||
}
|
||||
|
||||
return set(state, 'devices', devices);
|
||||
}
|
||||
case _SET_AUDIOMODE_SUBSCRIPTIONS:
|
||||
return set(state, 'subscriptions', action.subscriptions);
|
||||
}
|
||||
|
||||
return state;
|
||||
});
|
||||
Reference in New Issue
Block a user