Skip to content

Commit 18740ef

Browse files
Merge pull request #4 from Vishesh-Pandey/fix/invalid-published-page
fix loading issue for invalid published page
2 parents d8378b3 + 9b224a5 commit 18740ef

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/components/LiveRoom.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function LiveRoom() {
2121

2222
const onDataChange = (snapshot: { val(): TextData }) => {
2323
const data = snapshot.val();
24-
console.log(data);
2524
if (data !== null) {
2625
setText(data.text);
2726
} else {
@@ -37,7 +36,6 @@ function LiveRoom() {
3736

3837
// Clean up the event listener on component unmount
3938
return () => {
40-
console.log("exiting");
4139
unsubscribe();
4240
};
4341
}, []);

src/components/Navbar.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ import { Link, useLocation } from "react-router-dom";
33
function Navbar() {
44
const location = useLocation();
55

6-
const currentpath = location.pathname;
7-
8-
console.log(currentpath);
9-
106
return (
117
<>
128
<div className="border-b-2">
@@ -43,7 +39,7 @@ function Navbar() {
4339
Live Room
4440
</Link>
4541
</li>
46-
<li className="md:py-1 my-1 mx-1">
42+
<li className="md:py-1 my-1">
4743
<Link
4844
className={`p-4 mx-1 rounded-md duration-500 block ${
4945
location.pathname === "/about"

src/components/PublishedText.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ function PublishedText() {
1616
const docRef = doc(db, "sharedText", id ? id : "notfound");
1717
const docSnap = await getDoc(docRef);
1818
if (docSnap.exists()) {
19-
console.log("Document data:", docSnap.data());
2019
setText(docSnap.data().text);
2120
} else {
2221
// docSnap.data() will be undefined in this case
23-
console.log("Try making changes here!");
22+
setText(
23+
"v-share WARNING: This is invalid page or it doesn't exist anymore."
24+
);
2425
}
2526
};
2627

vite.config.ts.timestamp-1704527941995-6774b5f0cf6c.mjs

Whitespace-only changes.

0 commit comments

Comments
 (0)