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>
pull/28217/head
Michael Weimann 2023-04-06 16:02:18 +02:00 committed by GitHub
parent b73032145d
commit 818e8292cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -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");
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();
const listener = (ev: ButtonEvent): void => {
ev.stopPropagation();
const { publicRoom } = result;
viewRoom(
{

View File

@ -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");
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[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.objectContaining({
action: "view_room",