diff --git a/frontend/src/pages/Whiteboard/Whiteboard.js b/frontend/src/pages/Whiteboard/Whiteboard.js index 714ba71..c5ff0c7 100644 --- a/frontend/src/pages/Whiteboard/Whiteboard.js +++ b/frontend/src/pages/Whiteboard/Whiteboard.js @@ -27,6 +27,9 @@ const Whiteboard = () => { const navigate = useNavigate(); const [error, setError] = useState({ visible: false, message: "" }); const [cursor, setCursor] = useState(null); + const [loadingStatus, setLoadingStatus] = useState( + "Loading Whiteboard Elements..." + ); // get room code const location = useLocation(); @@ -54,6 +57,7 @@ const Whiteboard = () => { updateOrSetElements({ elements, myOwnChange: false }) ); } + setLoadingStatus(""); return; } @@ -86,11 +90,15 @@ const Whiteboard = () => { }) ); + setLoadingStatus("Connecting to Server..."); + // Connect to socketio connectToServer(); // add socketio listener listenToUpdateMessage(); + + setLoadingStatus(""); } catch (e) { if (e.name === "TypeError") { setError({ @@ -326,6 +334,12 @@ const Whiteboard = () => { return (
{loadingStatus}
+