Make web use the redux settings/profile

This commit is contained in:
zbettenbuk
2018-05-09 15:20:22 +02:00
committed by Saúl Ibarra Corretgé
parent ab7e572162
commit 959db3a665
29 changed files with 455 additions and 434 deletions
+4 -3
View File
@@ -1,7 +1,6 @@
/* global $, APP */
import UIUtil from '../../util/UIUtil';
import UIEvents from '../../../../service/UI/UIEvents';
import Settings from '../../../settings/Settings';
import {
createProfilePanelButtonEvent,
@@ -54,6 +53,8 @@ export default {
init(emitter) {
initHTML();
const settings = APP.store.getState()['features/base/settings'];
/**
* Updates display name.
*
@@ -64,7 +65,7 @@ export default {
}
$('#setDisplayName')
.val(Settings.getDisplayName())
.val(settings.displayName)
.keyup(event => {
if (event.keyCode === 13) { // enter
updateDisplayName();
@@ -82,7 +83,7 @@ export default {
}
$('#setEmail')
.val(Settings.getEmail())
.val(settings.email)
.keyup(event => {
if (event.keyCode === 13) { // enter
updateEmail();
-11
View File
@@ -74,17 +74,6 @@ const UIUtil = {
.html();
},
/**
* Unescapes the given text.
*
* @param {string} safe string which contains escaped html
* @returns {string} unescaped html string.
*/
unescapeHtml(safe) {
return $('<div />').html(safe)
.text();
},
imageToGrayScale(canvas) {
const context = canvas.getContext('2d');
const imgData = context.getImageData(0, 0, canvas.width, canvas.height);
+9 -3
View File
@@ -10,6 +10,7 @@ import { VideoTrack } from '../../../react/features/base/media';
import {
getAvatarURLByParticipantId
} from '../../../react/features/base/participants';
import { updateSettings } from '../../../react/features/base/settings';
/* eslint-enable no-unused-vars */
const logger = require('jitsi-meet-logger').getLogger(__filename);
@@ -121,9 +122,10 @@ LocalVideo.prototype.changeVideo = function(stream) {
// eslint-disable-next-line eqeqeq
const isVideo = stream.videoType != 'desktop';
const settings = APP.store.getState()['features/base/settings'];
this._enableDisableContextMenu(isVideo);
this.setFlipX(isVideo ? APP.settings.getLocalFlipX() : false);
this.setFlipX(isVideo ? settings.localFlipX : false);
const endedHandler = () => {
@@ -194,10 +196,14 @@ LocalVideo.prototype._buildContextMenu = function() {
flip: {
name: 'Flip',
callback: () => {
const val = !APP.settings.getLocalFlipX();
const { store } = APP;
const val = !store.getState()['features/base/settings']
.localFlipX;
this.setFlipX(val);
APP.settings.setLocalFlipX(val);
store.dispatch(updateSettings({
localFlipX: val
}));
}
}
},