Bail out of RoomSettingsDialog when room is not found (#10662)

* hack to fix console noise from unfaked timers and clearAllModals

* remove old debug logging in AsyncWrapper

* pass room to room settings tabs

* add errorboundary for roomsettingsdialog

* apply strictnullchecks to tabs/room

* dedupe code to set toom in roomsettingdialog

* add unit tests

* test SecurityRoomSettingsTab

* remove snapshot

* strict fixes

* more tests

* 2% more test coverage

* remove roomName from RoomSettingsDialogs state
This commit is contained in:
Kerry 2023-04-27 13:20:02 +12:00 committed by GitHub
parent f6e8ffe750
commit 223892bf0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 1077 additions and 121 deletions

View file

@ -15,23 +15,20 @@ limitations under the License.
*/
import React, { useContext } from "react";
import { Room } from "matrix-js-sdk/src/matrix";
import MatrixClientContext from "../../../../../contexts/MatrixClientContext";
import { PollHistory } from "../../../polls/pollHistory/PollHistory";
import { RoomPermalinkCreator } from "../../../../../utils/permalinks/Permalinks";
interface IProps {
roomId: string;
room: Room;
onFinished: () => void;
}
export const PollHistoryTab: React.FC<IProps> = ({ roomId, onFinished }) => {
export const PollHistoryTab: React.FC<IProps> = ({ room, onFinished }) => {
const matrixClient = useContext(MatrixClientContext);
const room = matrixClient.getRoom(roomId);
if (!room) {
return null;
}
const permalinkCreator = new RoomPermalinkCreator(room, roomId);
const permalinkCreator = new RoomPermalinkCreator(room, room.roomId);
return (
<div className="mx_SettingsTab">