Files
jitsi-meet/react/features/visitors/reducer.ts
Дамян Минков 649a4ffd46 feat(visitors): Updates mobile to handle redirected conf error. (#13110)
* feat(visitors): Updates mobile to handle redirected conf error.

* squash: Center the buttons when iAmVisitor.

* squash: Enables chat in visitor mode.

* feat: Prints the used lib-jitsi-meet.

* feat: Shows a notification when joining as a visitor.

* fix(notifications): display and fix styles for notifications in tile view

---------

Co-authored-by: Calin-Teodor <calin.chitu@8x8.com>
2023-03-28 08:08:56 -05:00

46 lines
1.0 KiB
TypeScript

import { CONFERENCE_WILL_LEAVE } from '../base/conference/actionTypes';
import ReducerRegistry from '../base/redux/ReducerRegistry';
import { I_AM_VISITOR_MODE, UPDATE_VISITORS_COUNT } from './actionTypes';
const DEFAULT_STATE = {
count: -1,
iAmVisitor: false,
showNotification: false
};
export interface IVisitorsState {
count?: number;
iAmVisitor: boolean;
showNotification: boolean;
}
ReducerRegistry.register<IVisitorsState>('features/visitors', (state = DEFAULT_STATE, action): IVisitorsState => {
switch (action.type) {
case CONFERENCE_WILL_LEAVE: {
return {
...state,
...DEFAULT_STATE
};
}
case UPDATE_VISITORS_COUNT: {
if (state.count === action.count) {
return state;
}
return {
...state,
count: action.count
};
}
case I_AM_VISITOR_MODE: {
return {
...state,
iAmVisitor: action.enabled,
showNotification: true
};
}
}
return state;
});