Auto-fix lint errors
This commit is contained in:
parent
4c5720a573
commit
ae0a8b8da4
625 changed files with 3170 additions and 3232 deletions
|
@ -54,7 +54,7 @@ class EditableAliasesList extends EditableItemList<IEditableAliasesListProps> {
|
|||
if (!this.props.domain) {
|
||||
return super.renderNewItemField();
|
||||
}
|
||||
const onChange = (alias) => this.onNewItemChanged({target: {value: alias}});
|
||||
const onChange = (alias) => this.onNewItemChanged({ target: { value: alias } });
|
||||
return (
|
||||
<form
|
||||
onSubmit={this.onAliasAdded}
|
||||
|
@ -179,9 +179,9 @@ export default class AliasSettings extends React.Component<IProps, IState> {
|
|||
"or a temporary failure occurred.",
|
||||
),
|
||||
});
|
||||
this.setState({canonicalAlias: oldAlias});
|
||||
this.setState({ canonicalAlias: oldAlias });
|
||||
}).finally(() => {
|
||||
this.setState({updatingCanonicalAlias: false});
|
||||
this.setState({ updatingCanonicalAlias: false });
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ export default class AliasSettings extends React.Component<IProps, IState> {
|
|||
),
|
||||
});
|
||||
}).finally(() => {
|
||||
this.setState({updatingCanonicalAlias: false});
|
||||
this.setState({ updatingCanonicalAlias: false });
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -253,7 +253,7 @@ export default class AliasSettings extends React.Component<IProps, IState> {
|
|||
// to this room. See https://github.com/vector-im/element-web/issues/7353
|
||||
MatrixClientPeg.get().deleteAlias(alias).then(() => {
|
||||
const localAliases = this.state.localAliases.filter(a => a !== alias);
|
||||
this.setState({localAliases});
|
||||
this.setState({ localAliases });
|
||||
|
||||
if (this.state.canonicalAlias === alias) {
|
||||
this.changeCanonicalAlias(null);
|
||||
|
@ -293,7 +293,7 @@ export default class AliasSettings extends React.Component<IProps, IState> {
|
|||
|
||||
private onNewAltAliasChanged = (value: string) => {
|
||||
this.setState({ newAltAlias: value });
|
||||
}
|
||||
};
|
||||
|
||||
private onAltAliasAdded = (alias: string) => {
|
||||
const altAliases = this.state.altAliases.slice();
|
||||
|
@ -302,20 +302,20 @@ export default class AliasSettings extends React.Component<IProps, IState> {
|
|||
this.changeAltAliases(altAliases);
|
||||
this.setState({ newAltAlias: "" });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private onAltAliasDeleted = (index: number) => {
|
||||
const altAliases = this.state.altAliases.slice();
|
||||
altAliases.splice(index, 1);
|
||||
this.changeAltAliases(altAliases);
|
||||
}
|
||||
};
|
||||
|
||||
private getAliases() {
|
||||
return this.state.altAliases.concat(this.getLocalNonAltAliases());
|
||||
}
|
||||
|
||||
private getLocalNonAltAliases() {
|
||||
const {altAliases} = this.state;
|
||||
const { altAliases } = this.state;
|
||||
return this.state.localAliases.filter(alias => !altAliases.includes(alias));
|
||||
}
|
||||
|
||||
|
|
|
@ -16,13 +16,13 @@ limitations under the License.
|
|||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {MatrixEvent} from 'matrix-js-sdk/src/models/event';
|
||||
import { MatrixEvent } from 'matrix-js-sdk/src/models/event';
|
||||
import * as sdk from '../../../index';
|
||||
import { _t } from '../../../languageHandler';
|
||||
import Modal from '../../../Modal';
|
||||
import ErrorDialog from "../dialogs/ErrorDialog";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
|
||||
const GROUP_ID_REGEX = /\+\S+:\S+/;
|
||||
|
||||
|
@ -116,7 +116,7 @@ export default class RelatedGroupSettings extends React.Component {
|
|||
itemsLabel={_t('Showing flair for these communities:')}
|
||||
noItemsLabel={_t('This room is not showing flair for any communities')}
|
||||
placeholder={_t(
|
||||
'New community ID (e.g. +foo:%(localDomain)s)', {localDomain},
|
||||
'New community ID (e.g. +foo:%(localDomain)s)', { localDomain },
|
||||
)}
|
||||
/>
|
||||
</div>;
|
||||
|
|
|
@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React, {createRef} from 'react';
|
||||
import React, { createRef } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {_t} from "../../../languageHandler";
|
||||
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
||||
import { _t } from "../../../languageHandler";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import Field from "../elements/Field";
|
||||
import * as sdk from "../../../index";
|
||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||
import {mediaFromMxc} from "../../../customisations/Media";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { mediaFromMxc } from "../../../customisations/Media";
|
||||
|
||||
// TODO: Merge with ProfileSettings?
|
||||
@replaceableComponent("views.room_settings.RoomProfileSettings")
|
||||
|
@ -97,7 +97,7 @@ export default class RoomProfileSettings extends React.Component {
|
|||
e.preventDefault();
|
||||
|
||||
if (!this.state.enableProfileSave) return;
|
||||
this.setState({enableProfileSave: false});
|
||||
this.setState({ enableProfileSave: false });
|
||||
|
||||
const client = MatrixClientPeg.get();
|
||||
const newState = {};
|
||||
|
@ -112,7 +112,7 @@ export default class RoomProfileSettings extends React.Component {
|
|||
|
||||
if (this.state.avatarFile) {
|
||||
const uri = await client.uploadContent(this.state.avatarFile);
|
||||
await client.sendStateEvent(this.props.roomId, 'm.room.avatar', {url: uri}, '');
|
||||
await client.sendStateEvent(this.props.roomId, 'm.room.avatar', { url: uri }, '');
|
||||
newState.avatarUrl = mediaFromMxc(uri).getSquareThumbnailHttp(96);
|
||||
newState.originalAvatarUrl = newState.avatarUrl;
|
||||
newState.avatarFile = null;
|
||||
|
@ -129,20 +129,20 @@ export default class RoomProfileSettings extends React.Component {
|
|||
};
|
||||
|
||||
_onDisplayNameChanged = (e) => {
|
||||
this.setState({displayName: e.target.value});
|
||||
this.setState({ displayName: e.target.value });
|
||||
if (this.state.originalDisplayName === e.target.value) {
|
||||
this.setState({enableProfileSave: false});
|
||||
this.setState({ enableProfileSave: false });
|
||||
} else {
|
||||
this.setState({enableProfileSave: true});
|
||||
this.setState({ enableProfileSave: true });
|
||||
}
|
||||
};
|
||||
|
||||
_onTopicChanged = (e) => {
|
||||
this.setState({topic: e.target.value});
|
||||
this.setState({ topic: e.target.value });
|
||||
if (this.state.originalTopic === e.target.value) {
|
||||
this.setState({enableProfileSave: false});
|
||||
this.setState({ enableProfileSave: false });
|
||||
} else {
|
||||
this.setState({enableProfileSave: true});
|
||||
this.setState({ enableProfileSave: true });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ export default class RoomPublishSetting extends React.PureComponent<IProps, ISta
|
|||
private onRoomPublishChange = (e) => {
|
||||
const valueBefore = this.state.isRoomPublished;
|
||||
const newValue = !valueBefore;
|
||||
this.setState({isRoomPublished: newValue});
|
||||
this.setState({ isRoomPublished: newValue });
|
||||
const client = MatrixClientPeg.get();
|
||||
|
||||
client.setRoomDirectoryVisibility(
|
||||
|
@ -52,14 +52,14 @@ export default class RoomPublishSetting extends React.PureComponent<IProps, ISta
|
|||
newValue ? 'public' : 'private',
|
||||
).catch(() => {
|
||||
// Roll back the local echo on the change
|
||||
this.setState({isRoomPublished: valueBefore});
|
||||
this.setState({ isRoomPublished: valueBefore });
|
||||
});
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
const client = MatrixClientPeg.get();
|
||||
client.getRoomDirectoryVisibility(this.props.roomId).then((result => {
|
||||
this.setState({isRoomPublished: result.visibility === 'public'});
|
||||
this.setState({ isRoomPublished: result.visibility === 'public' });
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,10 @@ import * as sdk from "../../../index";
|
|||
import { _t, _td } from '../../../languageHandler';
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import dis from "../../../dispatcher/dispatcher";
|
||||
import {MatrixClientPeg} from "../../../MatrixClientPeg";
|
||||
import {Action} from "../../../dispatcher/actions";
|
||||
import {SettingLevel} from "../../../settings/SettingLevel";
|
||||
import {replaceableComponent} from "../../../utils/replaceableComponent";
|
||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||
import { Action } from "../../../dispatcher/actions";
|
||||
import { SettingLevel } from "../../../settings/SettingLevel";
|
||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
|
||||
@replaceableComponent("views.room_settings.UrlPreviewSettings")
|
||||
export default class UrlPreviewSettings extends React.Component {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue