Replaced string actions with their corresponding types

This commit is contained in:
Swapnil Raj 2020-07-18 16:38:20 +05:30
parent 344185a375
commit 1d3635e1c8
12 changed files with 91 additions and 84 deletions

View file

@ -19,10 +19,11 @@ import dis from "./dispatcher/dispatcher";
import Modal from './Modal';
import * as sdk from './index';
import { _t } from './languageHandler';
import {RIGHT_PANEL_PHASES} from "./stores/RightPanelStorePhases";
import {RightPanelPhases} from "./stores/RightPanelStorePhases";
import {findDMForUser} from './createRoom';
import {accessSecretStorage} from './CrossSigningManager';
import {verificationMethods} from 'matrix-js-sdk/src/crypto';
import {Action} from './dispatcher/actions';
async function enable4SIfNeeded() {
const cli = MatrixClientPeg.get();
@ -91,8 +92,8 @@ export async function verifyDevice(user, device) {
verificationMethods.SAS,
);
dis.dispatch({
action: "set_right_panel_phase",
phase: RIGHT_PANEL_PHASES.EncryptionPanel,
action: Action.SetRightPanelPhase,
phase: RightPanelPhases.EncryptionPanel,
refireParams: {member: user, verificationRequestPromise},
});
} else if (action === "legacy") {
@ -120,8 +121,8 @@ export async function legacyVerifyUser(user) {
}
const verificationRequestPromise = cli.requestVerification(user.userId);
dis.dispatch({
action: "set_right_panel_phase",
phase: RIGHT_PANEL_PHASES.EncryptionPanel,
action: Action.SetRightPanelPhase,
phase: RightPanelPhases.EncryptionPanel,
refireParams: {member: user, verificationRequestPromise},
});
}
@ -132,8 +133,8 @@ export async function verifyUser(user) {
}
const existingRequest = pendingVerificationRequestForUser(user);
dis.dispatch({
action: "set_right_panel_phase",
phase: RIGHT_PANEL_PHASES.EncryptionPanel,
action: Action.SetRightPanelPhase,
phase: RightPanelPhases.EncryptionPanel,
refireParams: {
member: user,
verificationRequest: existingRequest,