Add opcode and bodyshop query to main
This commit is contained in:
@@ -1,33 +1,39 @@
|
||||
import "@ant-design/v5-patch-for-react-19";
|
||||
import { Layout } from "antd";
|
||||
import { User } from "firebase/auth";
|
||||
import { useState } from "react";
|
||||
import { BrowserRouter, Route, Routes } from "react-router";
|
||||
import ipcTypes from "../../util/ipcTypes.json";
|
||||
import NavigationHeader from "./components/NavigationHeader/Navigationheader";
|
||||
import SignInForm from "./components/SignInForm/SignInForm";
|
||||
import { auth } from "./util/firebase";
|
||||
import { useEffect, useState } from "react";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import { Provider } from "react-redux";
|
||||
import { BrowserRouter, Route, Routes } from "react-router";
|
||||
import ipcTypes from "../../util/ipcTypes";
|
||||
import ErrorBoundaryFallback from "./components/ErrorBoundaryFallback/ErrorBoundaryFallback";
|
||||
import Home from "./components/Home/Home";
|
||||
import NavigationHeader from "./components/NavigationHeader/Navigationheader";
|
||||
import Settings from "./components/Settings/Settings";
|
||||
import { Provider } from "react-redux";
|
||||
import SignInForm from "./components/SignInForm/SignInForm";
|
||||
import reduxStore from "./redux/redux-store";
|
||||
import { auth } from "./util/firebase";
|
||||
|
||||
const App: React.FC = () => {
|
||||
const [user, setUser] = useState<User | null>(null);
|
||||
|
||||
auth.onAuthStateChanged((user: User | null) => {
|
||||
setUser(user);
|
||||
//Send back to the main process so that it knows we are authenticated.
|
||||
if (user) {
|
||||
window.electron.ipcRenderer.send(
|
||||
ipcTypes.toMain.authStateChanged,
|
||||
user.toJSON()
|
||||
);
|
||||
window.electron.ipcRenderer.send(ipcTypes.toMain.watcher.start);
|
||||
}
|
||||
});
|
||||
useEffect(() => {
|
||||
// Only set up the listener once when component mounts
|
||||
const unsubscribe = auth.onAuthStateChanged((user: User | null) => {
|
||||
setUser(user);
|
||||
//Send back to the main process so that it knows we are authenticated.
|
||||
if (user) {
|
||||
window.electron.ipcRenderer.send(
|
||||
ipcTypes.toMain.authStateChanged,
|
||||
user.toJSON()
|
||||
);
|
||||
window.electron.ipcRenderer.send(ipcTypes.toMain.watcher.start);
|
||||
}
|
||||
});
|
||||
|
||||
// Clean up the listener when component unmounts
|
||||
return (): void => unsubscribe();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Provider store={reduxStore}>
|
||||
|
||||
Reference in New Issue
Block a user