Skip to content

Commit 0f5eb97

Browse files
committed
removed comments on main.tsx
1 parent 792b88a commit 0f5eb97

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

src/components/dashboard/sensors/customRegistry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SensorParser } from './parserRegistry';
66
* Used by CustomXPPSensor and the dynamic AddWidgets dropdown.
77
*/
88
export interface CustomSensorDef {
9-
/** Sensor name must match the NetworkTable key published by the XRP */
9+
/** Sensor name must match the NetworkTable key published by the XRP */
1010
sensorName: string;
1111
/** Display title */
1212
title: string;

src/main.tsx

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@ import App from '@/App.tsx'
77
import { GoogleOAuthProvider } from '@react-oauth/google';
88

99
function Root() {
10-
// const [googleClientId, setGoogleClientId] = useState<string | null>(null);
11-
// const googleAuthBackendUrl = import.meta.env.VITE_GOOGLE_AUTH_URL;
10+
const [googleClientId, setGoogleClientId] = useState<string | null>(null);
11+
const googleAuthBackendUrl = import.meta.env.VITE_GOOGLE_AUTH_URL;
1212

13-
// useEffect(() => {
14-
// const fetchClientId = async () => {
15-
// try {
16-
// const response = await fetch(`${googleAuthBackendUrl}/google-auth/client-id`);
17-
// if (!response.ok) {
18-
// throw new Error(`Failed to fetch client ID: ${response.statusText}`);
19-
// }
20-
// const data = await response.json();
21-
// setGoogleClientId(data.client_id);
22-
// } catch (error) {
23-
// console.error("Error fetching Google Client ID:", error);
24-
// // Handle error appropriately, e.g., show an error message to the user
25-
// }
26-
// };
27-
// fetchClientId();
28-
// }, []);
13+
useEffect(() => {
14+
const fetchClientId = async () => {
15+
try {
16+
const response = await fetch(`${googleAuthBackendUrl}/google-auth/client-id`);
17+
if (!response.ok) {
18+
throw new Error(`Failed to fetch client ID: ${response.statusText}`);
19+
}
20+
const data = await response.json();
21+
setGoogleClientId(data.client_id);
22+
} catch (error) {
23+
console.error("Error fetching Google Client ID:", error);
24+
// Handle error appropriately, e.g., show an error message to the user
25+
}
26+
};
27+
fetchClientId();
28+
}, []);
2929

30-
// if (!googleClientId) {
31-
// // Optionally render a loading spinner or message
32-
// return <div>Loading Google authentication...</div>;
33-
// }
30+
if (!googleClientId) {
31+
// Optionally render a loading spinner or message
32+
return <div>Loading Google authentication...</div>;
33+
}
3434

3535
return (
3636
<StrictMode>
37-
{/* <GoogleOAuthProvider clientId={googleClientId}> */}
38-
<App />
39-
{/* </GoogleOAuthProvider> */}
37+
<GoogleOAuthProvider clientId={googleClientId}>
38+
<App />
39+
</GoogleOAuthProvider>
4040
</StrictMode>
4141
);
4242
}

0 commit comments

Comments
 (0)