Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Just dismiss the toast when clicking »yes«
Browse files Browse the repository at this point in the history
  • Loading branch information
weeman1337 committed Feb 21, 2023
1 parent 7e80525 commit cf737ab
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
12 changes: 0 additions & 12 deletions src/toasts/UnverifiedSessionToast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import DeviceListener from "../DeviceListener";
import ToastStore from "../stores/ToastStore";
import GenericToast from "../components/views/toasts/GenericToast";
import { Action } from "../dispatcher/actions";
import Modal from "../Modal";
import VerificationRequestDialog from "../components/views/dialogs/VerificationRequestDialog";
import { isDeviceVerified } from "../utils/device/isDeviceVerified";
import { DeviceType } from "../utils/device/parseUserAgent";
import { DeviceMetaData } from "../components/views/settings/devices/DeviceMetaData";
Expand All @@ -38,16 +36,6 @@ export const showToast = async (deviceId: string): Promise<void> => {

const onAccept = (): void => {
DeviceListener.sharedInstance().dismissUnverifiedSessions([deviceId]);
const cli = MatrixClientPeg.get();
const userId = cli.getUserId();
const verificationRequestPromise = cli.requestVerification(userId, [deviceId]);
Modal.createDialog(VerificationRequestDialog, {
verificationRequestPromise,
member: cli.getUser(userId),
onFinished: async (): Promise<void> => {
(await verificationRequestPromise).cancel();
},
});
};

const onReject = (): void => {
Expand Down
6 changes: 0 additions & 6 deletions test/toasts/UnverifiedSessionToast-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ describe("UnverifiedSessionToast", () => {
});

itShouldDismissTheDevice();

it("should start the verification", () => {
expect(client.requestVerification).toHaveBeenCalledWith(client.getSafeUserId(), [
otherDevice.device_id,
]);
});
});

describe("and dismissing the login", () => {
Expand Down

0 comments on commit cf737ab

Please sign in to comment.