You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-07 21:23:00 +03:00
Fix send two join requests when joining a room from spotlight search (#10534)
* Fix send two join requests when joining a room from spotlight search * Trigger CI --------- Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2021-2022 The Matrix.org Foundation C.I.C.
|
Copyright 2021 - 2023 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@@ -624,6 +624,8 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
|||||||
clientRoom?.getMyMembership() === "join" || result.publicRoom.world_readable || cli.isGuest();
|
clientRoom?.getMyMembership() === "join" || result.publicRoom.world_readable || cli.isGuest();
|
||||||
|
|
||||||
const listener = (ev: ButtonEvent): void => {
|
const listener = (ev: ButtonEvent): void => {
|
||||||
|
ev.stopPropagation();
|
||||||
|
|
||||||
const { publicRoom } = result;
|
const { publicRoom } = result;
|
||||||
viewRoom(
|
viewRoom(
|
||||||
{
|
{
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2022 The Matrix.org Foundation C.I.C.
|
Copyright 2022 - 2023 The Matrix.org Foundation C.I.C.
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
@@ -376,7 +376,8 @@ describe("Spotlight Dialog", () => {
|
|||||||
expect(options.length).toBe(1);
|
expect(options.length).toBe(1);
|
||||||
expect(options[0].innerHTML).toContain(testPublicRoom.name);
|
expect(options[0].innerHTML).toContain(testPublicRoom.name);
|
||||||
|
|
||||||
fireEvent.click(options[0]!);
|
fireEvent.click(options[0].querySelector("[role='button']")!);
|
||||||
|
expect(defaultDispatcher.dispatch).toHaveBeenCalledTimes(1);
|
||||||
expect(defaultDispatcher.dispatch).toHaveBeenCalledWith(
|
expect(defaultDispatcher.dispatch).toHaveBeenCalledWith(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
action: "view_room",
|
action: "view_room",
|
||||||
|
Reference in New Issue
Block a user