Hristo Terezov 1f8fa3b6d4 Refactor settings modal (#3121)
* feat(settings): setting dialog

- Move device selection, profile edit, language select, moderator
  options, and server auth into one modal with tabs.
- Remove side panel profile and settings and logic used to update
  them.
- Pipe server auth status into redux to display in the settings
  dialog.
- Change filmstrip only device selection popup to use the new
  stateless settings dialog component.

* squash: do not show profile tab if not guest

* squash: profile button not clickable if no profile to show

* squash: nits

* ref: Settings dialog.
2018-06-20 13:19:53 -07:00

33 lines
688 B
JavaScript

// @flow
import { MiddlewareRegistry } from '../base/redux';
import { CLOSE_PANEL, TOGGLE_CHAT } from './actionTypes';
declare var APP: Object;
/**
* Middleware that catches actions related to the non-reactified web side panel.
*
* @param {Store} store - Redux store.
* @returns {Function}
*/
// eslint-disable-next-line no-unused-vars
MiddlewareRegistry.register(store => next => action => {
if (typeof APP !== 'object') {
return next(action);
}
switch (action.type) {
case CLOSE_PANEL:
APP.UI.toggleSidePanel(action.current);
break;
case TOGGLE_CHAT:
APP.UI.toggleChat();
break;
}
return next(action);
});