Comply w/ coding style

@virtuacoplenny, the changes of this commit are not necessarily in
source code that you introduced in
https://github.com/jitsi/jitsi-meet/pull/1499 but I saw violations in
files modified in the PR which I had to read in order to understand the
PR.
This commit is contained in:
Lyubo Marinov
2017-04-18 16:49:52 -05:00
parent 44b81b20e3
commit 55c3f5ddff
16 changed files with 211 additions and 147 deletions

View File

@@ -1,7 +1,8 @@
/* global APP */
import AKFieldText from '@atlaskit/field-text';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import AKFieldText from '@atlaskit/field-text';
import UIEvents from '../../../../service/UI/UIEvents';
@@ -39,7 +40,9 @@ class PasswordRequiredPrompt extends Component {
constructor(props) {
super(props);
this.state = { password: '' };
this.state = {
password: ''
};
this._onPasswordChanged = this._onPasswordChanged.bind(this);
this._onSubmit = this._onSubmit.bind(this);
@@ -69,19 +72,18 @@ class PasswordRequiredPrompt extends Component {
* @protected
*/
_renderBody() {
const { t } = this.props;
return (
<div>
<AKFieldText
compact = { true }
label = { t('dialog.passwordLabel') }
label = { this.props.t('dialog.passwordLabel') }
name = 'lockKey'
onChange = { this._onPasswordChanged }
shouldFitContainer = { true }
type = 'text'
value = { this.state.password } />
</div>);
</div>
);
}
/**
@@ -92,7 +94,9 @@ class PasswordRequiredPrompt extends Component {
* @returns {void}
*/
_onPasswordChanged(event) {
this.setState({ password: event.target.value });
this.setState({
password: event.target.value
});
}
/**
@@ -102,25 +106,26 @@ class PasswordRequiredPrompt extends Component {
* @returns {void}
*/
_onSubmit() {
const conference = this.props.conference;
const { conference } = this.props;
// we received that password is required, but user is trying
// anyway to login without a password, mark room as not
// locked in case he succeeds (maybe someone removed the
// password meanwhile), if it is still locked another
// password required will be received and the room again
// will be marked as locked.
// We received that password is required, but user is trying anyway to
// login without a password. Mark the room as not locked in case she
// succeeds (maybe someone removed the password meanwhile). If it is
// still locked, another password required will be received and the room
// again will be marked as locked.
if (!this.state.password || this.state.password === '') {
// XXX temporary solution while some components are not listening
// for lock state updates in redux
// XXX Temporary solution while some components are not listening
// for lock state updates in redux.
APP.UI.emitEvent(UIEvents.TOGGLE_ROOM_LOCK, false);
}
this.props.dispatch(setPassword(
conference, conference.join, this.state.password));
this.props.dispatch(
setPassword(conference, conference.join, this.state.password));
// we have used the password lets clean it
this.setState({ password: undefined });
// We have used the password so let's clean it.
this.setState({
password: undefined
});
return true;
}