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:
parent
f6e8ffe750
commit
223892bf0e
19 changed files with 1077 additions and 121 deletions
|
@ -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">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue