mirror of
https://github.com/netzbegruenung/jitsi-meet-electron.git
synced 2024-04-28 06:44:52 +02:00
25 lines
576 B
JavaScript
25 lines
576 B
JavaScript
|
// @flow
|
||
|
|
||
|
import { getAvatarURL } from '../utils';
|
||
|
import { SET_EMAIL, SET_NAME } from './actionTypes';
|
||
|
import { setAvatarURL } from './actions';
|
||
|
|
||
|
export default (store: Object) => (next: Function) => (action: Object) => {
|
||
|
const result = next(action);
|
||
|
const state = store.getState();
|
||
|
|
||
|
switch (action.type) {
|
||
|
case SET_EMAIL:
|
||
|
case SET_NAME: {
|
||
|
const avatarURL = getAvatarURL({
|
||
|
email: state.settings.email,
|
||
|
id: state.settings.name
|
||
|
});
|
||
|
|
||
|
store.dispatch(setAvatarURL(avatarURL));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return result;
|
||
|
};
|