mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-14 11:47:46 +00:00
* 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>
46 lines
1.0 KiB
TypeScript
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;
|
|
});
|