You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Fifth batch of burning
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -33,7 +33,7 @@ export const EMOJI_HEIGHT = 37;
|
|||||||
export const EMOJIS_PER_ROW = 8;
|
export const EMOJIS_PER_ROW = 8;
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
selectedEmojis: Set<string>;
|
selectedEmojis?: Set<string>;
|
||||||
showQuickReactions?: boolean;
|
showQuickReactions?: boolean;
|
||||||
onChoose(unicode: string): boolean;
|
onChoose(unicode: string): boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import React from 'react';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../MatrixClientPeg';
|
||||||
import * as sdk from '../../../index';
|
|
||||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||||
import { Room } from "matrix-js-sdk/src/models/room";
|
import { Room } from "matrix-js-sdk/src/models/room";
|
||||||
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
|
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
|
||||||
@@ -44,13 +43,14 @@ import SendMessageComposer from "./SendMessageComposer";
|
|||||||
import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload";
|
import { ComposerInsertPayload } from "../../../dispatcher/payloads/ComposerInsertPayload";
|
||||||
import { Action } from "../../../dispatcher/actions";
|
import { Action } from "../../../dispatcher/actions";
|
||||||
import EditorModel from "../../../editor/model";
|
import EditorModel from "../../../editor/model";
|
||||||
|
import EmojiPicker from '../emojipicker/EmojiPicker';
|
||||||
|
import MemberStatusMessageAvatar from "../avatars/MemberStatusMessageAvatar";
|
||||||
|
|
||||||
interface IComposerAvatarProps {
|
interface IComposerAvatarProps {
|
||||||
me: object;
|
me: object;
|
||||||
}
|
}
|
||||||
|
|
||||||
function ComposerAvatar(props: IComposerAvatarProps) {
|
function ComposerAvatar(props: IComposerAvatarProps) {
|
||||||
const MemberStatusMessageAvatar = sdk.getComponent('avatars.MemberStatusMessageAvatar');
|
|
||||||
return <div className="mx_MessageComposer_avatar">
|
return <div className="mx_MessageComposer_avatar">
|
||||||
<MemberStatusMessageAvatar member={props.me} width={24} height={24} />
|
<MemberStatusMessageAvatar member={props.me} width={24} height={24} />
|
||||||
</div>;
|
</div>;
|
||||||
@@ -76,7 +76,6 @@ const EmojiButton = ({ addEmoji }) => {
|
|||||||
let contextMenu;
|
let contextMenu;
|
||||||
if (menuDisplayed) {
|
if (menuDisplayed) {
|
||||||
const buttonRect = button.current.getBoundingClientRect();
|
const buttonRect = button.current.getBoundingClientRect();
|
||||||
const EmojiPicker = sdk.getComponent('emojipicker.EmojiPicker');
|
|
||||||
contextMenu = <ContextMenu {...aboveLeftOf(buttonRect)} onFinished={closeMenu} managed={false}>
|
contextMenu = <ContextMenu {...aboveLeftOf(buttonRect)} onFinished={closeMenu} managed={false}>
|
||||||
<EmojiPicker onChoose={addEmoji} showQuickReactions={true} />
|
<EmojiPicker onChoose={addEmoji} showQuickReactions={true} />
|
||||||
</ContextMenu>;
|
</ContextMenu>;
|
||||||
@@ -366,8 +365,6 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (!this.state.tombstone && this.state.canSendMessages) {
|
if (!this.state.tombstone && this.state.canSendMessages) {
|
||||||
const SendMessageComposer = sdk.getComponent("rooms.SendMessageComposer");
|
|
||||||
|
|
||||||
controls.push(
|
controls.push(
|
||||||
<SendMessageComposer
|
<SendMessageComposer
|
||||||
ref={(c) => this.messageComposerInput = c}
|
ref={(c) => this.messageComposerInput = c}
|
||||||
|
|||||||
@@ -20,13 +20,14 @@ import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
|||||||
import { Room } from "matrix-js-sdk/src/models/room";
|
import { Room } from "matrix-js-sdk/src/models/room";
|
||||||
import { _t } from "../../../languageHandler";
|
import { _t } from "../../../languageHandler";
|
||||||
import dis from "../../../dispatcher/dispatcher";
|
import dis from "../../../dispatcher/dispatcher";
|
||||||
import * as sdk from "../../../index";
|
|
||||||
import Modal from "../../../Modal";
|
import Modal from "../../../Modal";
|
||||||
import { isValid3pidInvite } from "../../../RoomInvite";
|
import { isValid3pidInvite } from "../../../RoomInvite";
|
||||||
import RoomAvatar from "../avatars/RoomAvatar";
|
import RoomAvatar from "../avatars/RoomAvatar";
|
||||||
import RoomName from "../elements/RoomName";
|
import RoomName from "../elements/RoomName";
|
||||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||||
import SettingsStore from "../../../settings/SettingsStore";
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
|
import ErrorDialog from '../dialogs/ErrorDialog';
|
||||||
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
event: MatrixEvent;
|
event: MatrixEvent;
|
||||||
@@ -104,7 +105,6 @@ export default class ThirdPartyMemberInfo extends React.Component<IProps, IState
|
|||||||
// Revert echo because of error
|
// Revert echo because of error
|
||||||
this.setState({ invited: true });
|
this.setState({ invited: true });
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Revoke 3pid invite failed', '', ErrorDialog, {
|
Modal.createTrackedDialog('Revoke 3pid invite failed', '', ErrorDialog, {
|
||||||
title: _t("Failed to revoke invite"),
|
title: _t("Failed to revoke invite"),
|
||||||
description: _t(
|
description: _t(
|
||||||
@@ -119,8 +119,6 @@ export default class ThirdPartyMemberInfo extends React.Component<IProps, IState
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const AccessibleButton = sdk.getComponent("elements.AccessibleButton");
|
|
||||||
|
|
||||||
let adminTools = null;
|
let adminTools = null;
|
||||||
if (this.state.canKick && this.state.invited) {
|
if (this.state.canKick && this.state.invited) {
|
||||||
adminTools = (
|
adminTools = (
|
||||||
|
|||||||
@@ -16,15 +16,14 @@ limitations under the License.
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import * as sdk from '../../../index';
|
|
||||||
import { _t } from "../../../languageHandler";
|
import { _t } from "../../../languageHandler";
|
||||||
import { SettingLevel } from "../../../settings/SettingLevel";
|
import { SettingLevel } from "../../../settings/SettingLevel";
|
||||||
import SettingsStore from "../../../settings/SettingsStore";
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
|
import SettingsFlag from '../elements/SettingsFlag';
|
||||||
|
|
||||||
const SETTING_MANUALLY_VERIFY_ALL_SESSIONS = "e2ee.manuallyVerifyAllSessions";
|
const SETTING_MANUALLY_VERIFY_ALL_SESSIONS = "e2ee.manuallyVerifyAllSessions";
|
||||||
|
|
||||||
const E2eAdvancedPanel = props => {
|
const E2eAdvancedPanel = props => {
|
||||||
const SettingsFlag = sdk.getComponent('views.elements.SettingsFlag');
|
|
||||||
return <div className="mx_SettingsTab_section">
|
return <div className="mx_SettingsTab_section">
|
||||||
<span className="mx_SettingsTab_subheading">{_t("Encryption")}</span>
|
<span className="mx_SettingsTab_subheading">{_t("Encryption")}</span>
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import React from 'react';
|
|||||||
|
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import SdkConfig from "../../../SdkConfig";
|
import SdkConfig from "../../../SdkConfig";
|
||||||
import * as sdk from '../../../index';
|
|
||||||
import Modal from '../../../Modal';
|
import Modal from '../../../Modal';
|
||||||
import SettingsStore from "../../../settings/SettingsStore";
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
import AccessibleButton from "../elements/AccessibleButton";
|
import AccessibleButton from "../elements/AccessibleButton";
|
||||||
@@ -27,6 +26,7 @@ import EventIndexPeg from "../../../indexing/EventIndexPeg";
|
|||||||
import { SettingLevel } from "../../../settings/SettingLevel";
|
import { SettingLevel } from "../../../settings/SettingLevel";
|
||||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||||
import SeshatResetDialog from '../dialogs/SeshatResetDialog';
|
import SeshatResetDialog from '../dialogs/SeshatResetDialog';
|
||||||
|
import InlineSpinner from '../elements/InlineSpinner';
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
enabling: boolean;
|
enabling: boolean;
|
||||||
@@ -147,7 +147,6 @@ export default class EventIndexPanel extends React.Component<{}, IState> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
let eventIndexingSettings = null;
|
let eventIndexingSettings = null;
|
||||||
const InlineSpinner = sdk.getComponent('elements.InlineSpinner');
|
|
||||||
const brand = SdkConfig.get().brand;
|
const brand = SdkConfig.get().brand;
|
||||||
|
|
||||||
if (EventIndexPeg.get() !== null) {
|
if (EventIndexPeg.get() !== null) {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
import url from 'url';
|
import url from 'url';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { _t } from "../../../languageHandler";
|
import { _t } from "../../../languageHandler";
|
||||||
import * as sdk from '../../../index';
|
|
||||||
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
import { MatrixClientPeg } from "../../../MatrixClientPeg";
|
||||||
import Modal from '../../../Modal';
|
import Modal from '../../../Modal';
|
||||||
import dis from "../../../dispatcher/dispatcher";
|
import dis from "../../../dispatcher/dispatcher";
|
||||||
@@ -28,6 +27,10 @@ import { getDefaultIdentityServerUrl, doesIdentityServerHaveTerms } from '../../
|
|||||||
import { timeout } from "../../../utils/promise";
|
import { timeout } from "../../../utils/promise";
|
||||||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||||
import { ActionPayload } from '../../../dispatcher/payloads';
|
import { ActionPayload } from '../../../dispatcher/payloads';
|
||||||
|
import InlineSpinner from '../elements/InlineSpinner';
|
||||||
|
import AccessibleButton from '../elements/AccessibleButton';
|
||||||
|
import Field from '../elements/Field';
|
||||||
|
import QuestionDialog from "../dialogs/QuestionDialog";
|
||||||
|
|
||||||
// We'll wait up to this long when checking for 3PID bindings on the IS.
|
// We'll wait up to this long when checking for 3PID bindings on the IS.
|
||||||
const REACHABILITY_TIMEOUT = 10000; // ms
|
const REACHABILITY_TIMEOUT = 10000; // ms
|
||||||
@@ -126,7 +129,6 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||||||
|
|
||||||
private getTooltip = () => {
|
private getTooltip = () => {
|
||||||
if (this.state.checking) {
|
if (this.state.checking) {
|
||||||
const InlineSpinner = sdk.getComponent('views.elements.InlineSpinner');
|
|
||||||
return <div>
|
return <div>
|
||||||
<InlineSpinner />
|
<InlineSpinner />
|
||||||
{ _t("Checking server") }
|
{ _t("Checking server") }
|
||||||
@@ -217,7 +219,6 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private showNoTermsWarning(fullUrl) {
|
private showNoTermsWarning(fullUrl) {
|
||||||
const QuestionDialog = sdk.getComponent("views.dialogs.QuestionDialog");
|
|
||||||
const { finished } = Modal.createTrackedDialog('No Terms Warning', '', QuestionDialog, {
|
const { finished } = Modal.createTrackedDialog('No Terms Warning', '', QuestionDialog, {
|
||||||
title: _t("Identity server has no terms of service"),
|
title: _t("Identity server has no terms of service"),
|
||||||
description: (
|
description: (
|
||||||
@@ -319,7 +320,6 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||||||
message = unboundMessage;
|
message = unboundMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
|
||||||
const { finished } = Modal.createTrackedDialog('Identity Server Bound Warning', '', QuestionDialog, {
|
const { finished } = Modal.createTrackedDialog('Identity Server Bound Warning', '', QuestionDialog, {
|
||||||
title,
|
title,
|
||||||
description: message,
|
description: message,
|
||||||
@@ -352,8 +352,6 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const AccessibleButton = sdk.getComponent('views.elements.AccessibleButton');
|
|
||||||
const Field = sdk.getComponent('elements.Field');
|
|
||||||
const idServerUrl = this.state.currentClientIdServer;
|
const idServerUrl = this.state.currentClientIdServer;
|
||||||
let sectionTitle;
|
let sectionTitle;
|
||||||
let bodyText;
|
let bodyText;
|
||||||
@@ -398,7 +396,6 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||||||
discoButtonContent = _t("Do not use an identity server");
|
discoButtonContent = _t("Do not use an identity server");
|
||||||
}
|
}
|
||||||
if (this.state.disconnectBusy) {
|
if (this.state.disconnectBusy) {
|
||||||
const InlineSpinner = sdk.getComponent('views.elements.InlineSpinner');
|
|
||||||
discoButtonContent = <InlineSpinner />;
|
discoButtonContent = <InlineSpinner />;
|
||||||
}
|
}
|
||||||
discoSection = <div>
|
discoSection = <div>
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { _t, _td } from "../../../../../languageHandler";
|
import { _t, _td } from "../../../../../languageHandler";
|
||||||
import { MatrixClientPeg } from "../../../../../MatrixClientPeg";
|
import { MatrixClientPeg } from "../../../../../MatrixClientPeg";
|
||||||
import * as sdk from "../../../../..";
|
|
||||||
import AccessibleButton from "../../../elements/AccessibleButton";
|
import AccessibleButton from "../../../elements/AccessibleButton";
|
||||||
import Modal from "../../../../../Modal";
|
import Modal from "../../../../../Modal";
|
||||||
import { replaceableComponent } from "../../../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../../../utils/replaceableComponent";
|
||||||
@@ -26,6 +25,8 @@ import { RoomMember } from "matrix-js-sdk/src/models/room-member";
|
|||||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||||
import { RoomState } from "matrix-js-sdk/src/models/room-state";
|
import { RoomState } from "matrix-js-sdk/src/models/room-state";
|
||||||
import { compare } from "../../../../../utils/strings";
|
import { compare } from "../../../../../utils/strings";
|
||||||
|
import ErrorDialog from '../../../dialogs/ErrorDialog';
|
||||||
|
import PowerSelector from "../../../elements/PowerSelector";
|
||||||
|
|
||||||
const plEventsToLabels = {
|
const plEventsToLabels = {
|
||||||
// These will be translated for us later.
|
// These will be translated for us later.
|
||||||
@@ -76,7 +77,6 @@ interface IBannedUserProps {
|
|||||||
export class BannedUser extends React.Component<IBannedUserProps> {
|
export class BannedUser extends React.Component<IBannedUserProps> {
|
||||||
private onUnbanClick = (e) => {
|
private onUnbanClick = (e) => {
|
||||||
MatrixClientPeg.get().unban(this.props.member.roomId, this.props.member.userId).catch((err) => {
|
MatrixClientPeg.get().unban(this.props.member.roomId, this.props.member.userId).catch((err) => {
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
console.error("Failed to unban: " + err);
|
console.error("Failed to unban: " + err);
|
||||||
Modal.createTrackedDialog('Failed to unban', '', ErrorDialog, {
|
Modal.createTrackedDialog('Failed to unban', '', ErrorDialog, {
|
||||||
title: _t('Error'),
|
title: _t('Error'),
|
||||||
@@ -176,7 +176,6 @@ export default class RolesRoomSettingsTab extends React.Component<IProps> {
|
|||||||
client.sendStateEvent(this.props.roomId, "m.room.power_levels", plContent).catch(e => {
|
client.sendStateEvent(this.props.roomId, "m.room.power_levels", plContent).catch(e => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Power level requirement change failed', '', ErrorDialog, {
|
Modal.createTrackedDialog('Power level requirement change failed', '', ErrorDialog, {
|
||||||
title: _t('Error changing power level requirement'),
|
title: _t('Error changing power level requirement'),
|
||||||
description: _t(
|
description: _t(
|
||||||
@@ -203,7 +202,6 @@ export default class RolesRoomSettingsTab extends React.Component<IProps> {
|
|||||||
client.sendStateEvent(this.props.roomId, "m.room.power_levels", plContent).catch(e => {
|
client.sendStateEvent(this.props.roomId, "m.room.power_levels", plContent).catch(e => {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Power level change failed', '', ErrorDialog, {
|
Modal.createTrackedDialog('Power level change failed', '', ErrorDialog, {
|
||||||
title: _t('Error changing power level'),
|
title: _t('Error changing power level'),
|
||||||
description: _t(
|
description: _t(
|
||||||
@@ -215,8 +213,6 @@ export default class RolesRoomSettingsTab extends React.Component<IProps> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const PowerSelector = sdk.getComponent('elements.PowerSelector');
|
|
||||||
|
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const room = client.getRoom(this.props.roomId);
|
const room = client.getRoom(this.props.roomId);
|
||||||
const plEvent = room.currentState.getStateEvents('m.room.power_levels', '');
|
const plEvent = room.currentState.getStateEvents('m.room.power_levels', '');
|
||||||
|
|||||||
@@ -22,8 +22,11 @@ import { ListRule } from "../../../../../mjolnir/ListRule";
|
|||||||
import { BanList, RULE_SERVER, RULE_USER } from "../../../../../mjolnir/BanList";
|
import { BanList, RULE_SERVER, RULE_USER } from "../../../../../mjolnir/BanList";
|
||||||
import Modal from "../../../../../Modal";
|
import Modal from "../../../../../Modal";
|
||||||
import { MatrixClientPeg } from "../../../../../MatrixClientPeg";
|
import { MatrixClientPeg } from "../../../../../MatrixClientPeg";
|
||||||
import * as sdk from "../../../../../index";
|
|
||||||
import { replaceableComponent } from "../../../../../utils/replaceableComponent";
|
import { replaceableComponent } from "../../../../../utils/replaceableComponent";
|
||||||
|
import ErrorDialog from "../../../dialogs/ErrorDialog";
|
||||||
|
import QuestionDialog from "../../../dialogs/QuestionDialog";
|
||||||
|
import AccessibleButton from "../../../elements/AccessibleButton";
|
||||||
|
import Field from "../../../elements/Field";
|
||||||
|
|
||||||
interface IState {
|
interface IState {
|
||||||
busy: boolean;
|
busy: boolean;
|
||||||
@@ -68,7 +71,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Failed to add Mjolnir rule', '', ErrorDialog, {
|
Modal.createTrackedDialog('Failed to add Mjolnir rule', '', ErrorDialog, {
|
||||||
title: _t('Error adding ignored user/server'),
|
title: _t('Error adding ignored user/server'),
|
||||||
description: _t('Something went wrong. Please try again or view your console for hints.'),
|
description: _t('Something went wrong. Please try again or view your console for hints.'),
|
||||||
@@ -90,7 +92,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Failed to subscribe to Mjolnir list', '', ErrorDialog, {
|
Modal.createTrackedDialog('Failed to subscribe to Mjolnir list', '', ErrorDialog, {
|
||||||
title: _t('Error subscribing to list'),
|
title: _t('Error subscribing to list'),
|
||||||
description: _t('Please verify the room ID or address and try again.'),
|
description: _t('Please verify the room ID or address and try again.'),
|
||||||
@@ -108,7 +109,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Failed to remove Mjolnir rule', '', ErrorDialog, {
|
Modal.createTrackedDialog('Failed to remove Mjolnir rule', '', ErrorDialog, {
|
||||||
title: _t('Error removing ignored user/server'),
|
title: _t('Error removing ignored user/server'),
|
||||||
description: _t('Something went wrong. Please try again or view your console for hints.'),
|
description: _t('Something went wrong. Please try again or view your console for hints.'),
|
||||||
@@ -126,7 +126,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Failed to unsubscribe from Mjolnir list', '', ErrorDialog, {
|
Modal.createTrackedDialog('Failed to unsubscribe from Mjolnir list', '', ErrorDialog, {
|
||||||
title: _t('Error unsubscribing from list'),
|
title: _t('Error unsubscribing from list'),
|
||||||
description: _t('Please try again or view your console for hints.'),
|
description: _t('Please try again or view your console for hints.'),
|
||||||
@@ -137,8 +136,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private viewListRules(list: BanList) {
|
private viewListRules(list: BanList) {
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
|
||||||
|
|
||||||
const room = MatrixClientPeg.get().getRoom(list.roomId);
|
const room = MatrixClientPeg.get().getRoom(list.roomId);
|
||||||
const name = room ? room.name : list.roomId;
|
const name = room ? room.name : list.roomId;
|
||||||
|
|
||||||
@@ -168,8 +165,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private renderPersonalBanListRules() {
|
private renderPersonalBanListRules() {
|
||||||
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
|
||||||
|
|
||||||
const list = Mjolnir.sharedInstance().getPersonalList();
|
const list = Mjolnir.sharedInstance().getPersonalList();
|
||||||
const rules = list ? [...list.userRules, ...list.serverRules] : [];
|
const rules = list ? [...list.userRules, ...list.serverRules] : [];
|
||||||
if (!list || rules.length <= 0) return <i>{_t("You have not ignored anyone.")}</i>;
|
if (!list || rules.length <= 0) return <i>{_t("You have not ignored anyone.")}</i>;
|
||||||
@@ -199,8 +194,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private renderSubscribedBanLists() {
|
private renderSubscribedBanLists() {
|
||||||
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
|
||||||
|
|
||||||
const personalList = Mjolnir.sharedInstance().getPersonalList();
|
const personalList = Mjolnir.sharedInstance().getPersonalList();
|
||||||
const lists = Mjolnir.sharedInstance().lists.filter(b => {
|
const lists = Mjolnir.sharedInstance().lists.filter(b => {
|
||||||
return personalList? personalList.roomId !== b.roomId : true;
|
return personalList? personalList.roomId !== b.roomId : true;
|
||||||
@@ -241,8 +234,6 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const Field = sdk.getComponent('elements.Field');
|
|
||||||
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
|
|
||||||
const brand = SdkConfig.get().brand;
|
const brand = SdkConfig.get().brand;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ class RoomViewStore extends Store<ActionPayload> {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'open_room_settings': {
|
case 'open_room_settings': {
|
||||||
|
// FIXME: Using an import will result in test failures
|
||||||
const RoomSettingsDialog = sdk.getComponent("dialogs.RoomSettingsDialog");
|
const RoomSettingsDialog = sdk.getComponent("dialogs.RoomSettingsDialog");
|
||||||
Modal.createTrackedDialog('Room settings', '', RoomSettingsDialog, {
|
Modal.createTrackedDialog('Room settings', '', RoomSettingsDialog, {
|
||||||
roomId: payload.room_id || this.state.roomId,
|
roomId: payload.room_id || this.state.roomId,
|
||||||
@@ -340,6 +341,7 @@ class RoomViewStore extends Store<ActionPayload> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Using an import will result in test failures
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
Modal.createTrackedDialog('Failed to join room', '', ErrorDialog, {
|
Modal.createTrackedDialog('Failed to join room', '', ErrorDialog, {
|
||||||
title: _t("Failed to join room"),
|
title: _t("Failed to join room"),
|
||||||
|
|||||||
Reference in New Issue
Block a user