From 8f2082d092a58c3f3ab32c52b1f3df2b8e0eebd7 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Wed, 6 Oct 2021 11:19:42 -0700 Subject: [PATCH] Use hash based routing --- src/App.jsx | 2 +- src/Room.jsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 28d842ba..d69637f2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -16,7 +16,7 @@ limitations under the License. import React from "react"; import { - BrowserRouter as Router, + HashRouter as Router, Switch, Route, Redirect, diff --git a/src/Room.jsx b/src/Room.jsx index fa5b0813..155d5072 100644 --- a/src/Room.jsx +++ b/src/Room.jsx @@ -16,7 +16,7 @@ limitations under the License. import React, { useEffect, useMemo, useState } from "react"; import styles from "./Room.module.css"; -import { useParams } from "react-router-dom"; +import { useLocation, useParams } from "react-router-dom"; import { HangupButton, MicButton, @@ -53,7 +53,9 @@ function useLoadGroupCall(client, roomId) { } export function Room({ client }) { - const { roomId } = useParams(); + const { roomId: maybeRoomId } = useParams(); + const { hash } = useLocation(); + const roomId = maybeRoomId || hash; const { loading, error, groupCall } = useLoadGroupCall(client, roomId); if (loading) {