Fix creating rooms from not found screen

This commit is contained in:
Robert Long
2022-02-23 15:36:38 -08:00
parent 42e2041d6f
commit 641b82dc45
3 changed files with 21 additions and 12 deletions

View File

@@ -8,7 +8,7 @@ import { Form } from "../form/Form";
import { useHistory } from "react-router-dom";
import styles from "./RoomNotFoundView.module.css";
export function RoomNotFoundView({ client, roomId }) {
export function RoomNotFoundView({ client, roomId, onReload }) {
const history = useHistory();
const [loading, setLoading] = useState(false);
const [error, setError] = useState();
@@ -21,11 +21,9 @@ export function RoomNotFoundView({ client, roomId }) {
setError(undefined);
setLoading(true);
const roomIdOrAlias = await createRoom(client, roomName);
await createRoom(client, roomName);
if (roomIdOrAlias) {
history.push(`/room/${roomIdOrAlias}`);
}
onReload();
}
submit().catch((error) => {