mirror of https://github.com/vector-im/riot-web
parent
b3c3ef594e
commit
3060cdf934
|
@ -74,6 +74,7 @@ import {
|
||||||
} from "../../toasts/AnalyticsToast";
|
} from "../../toasts/AnalyticsToast";
|
||||||
import {showToast as showNotificationsToast} from "../../toasts/DesktopNotificationsToast";
|
import {showToast as showNotificationsToast} from "../../toasts/DesktopNotificationsToast";
|
||||||
import { OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload";
|
import { OpenToTabPayload } from "../../dispatcher/payloads/OpenToTabPayload";
|
||||||
|
import ErrorDialog from "../views/dialogs/ErrorDialog";
|
||||||
|
|
||||||
/** constants for MatrixChat.state.view */
|
/** constants for MatrixChat.state.view */
|
||||||
export enum Views {
|
export enum Views {
|
||||||
|
@ -460,7 +461,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
|
|
||||||
onAction = (payload) => {
|
onAction = (payload) => {
|
||||||
// console.log(`MatrixClientPeg.onAction: ${payload.action}`);
|
// console.log(`MatrixClientPeg.onAction: ${payload.action}`);
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
|
|
||||||
// Start the onboarding process for certain actions
|
// Start the onboarding process for certain actions
|
||||||
|
@ -1063,7 +1063,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
|
|
||||||
private leaveRoom(roomId: string) {
|
private leaveRoom(roomId: string) {
|
||||||
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
const roomToLeave = MatrixClientPeg.get().getRoom(roomId);
|
const roomToLeave = MatrixClientPeg.get().getRoom(roomId);
|
||||||
const warnings = this.leaveRoomWarnings(roomId);
|
const warnings = this.leaveRoomWarnings(roomId);
|
||||||
|
|
||||||
|
@ -1128,13 +1127,12 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private forgetRoom(roomId: string) {
|
private forgetRoom(roomId: string) {
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
MatrixClientPeg.get().forget(roomId).then(() => {
|
MatrixClientPeg.get().forget(roomId).then(() => {
|
||||||
// Switch to another room view if we're currently viewing the historical room
|
// Switch to another room view if we're currently viewing the historical room
|
||||||
if (this.state.currentRoomId === roomId) {
|
if (this.state.currentRoomId === roomId) {
|
||||||
dis.dispatch({ action: "view_next_room" });
|
dis.dispatch({ action: "view_next_room" });
|
||||||
}
|
}
|
||||||
}, function(err) {
|
}).catch((err) => {
|
||||||
const errCode = err.errcode || _td("unknown error code");
|
const errCode = err.errcode || _td("unknown error code");
|
||||||
Modal.createTrackedDialog("Failed to forget room", '', ErrorDialog, {
|
Modal.createTrackedDialog("Failed to forget room", '', ErrorDialog, {
|
||||||
title: _t("Failed to forget room %(errCode)s", {errCode}),
|
title: _t("Failed to forget room %(errCode)s", {errCode}),
|
||||||
|
@ -1391,7 +1389,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
Modal.createTrackedDialog('Signed out', '', ErrorDialog, {
|
Modal.createTrackedDialog('Signed out', '', ErrorDialog, {
|
||||||
title: _t('Signed Out'),
|
title: _t('Signed Out'),
|
||||||
description: _t('For security, this session has been signed out. Please sign in again.'),
|
description: _t('For security, this session has been signed out. Please sign in again.'),
|
||||||
|
@ -1461,7 +1458,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cli.on("crypto.warning", (type) => {
|
cli.on("crypto.warning", (type) => {
|
||||||
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'CRYPTO_WARNING_OLD_VERSION_DETECTED':
|
case 'CRYPTO_WARNING_OLD_VERSION_DETECTED':
|
||||||
Modal.createTrackedDialog('Crypto migrated', '', ErrorDialog, {
|
Modal.createTrackedDialog('Crypto migrated', '', ErrorDialog, {
|
||||||
|
|
Loading…
Reference in New Issue