setup electron multi-window architecture (#102)
* prototype with two windows * use deps in separate window render process * enhance autoplay into desktop overlay * fix: autoplay window not applying tailwind styles
This commit was merged in pull request #102.
This commit is contained in:
+14
-1
@@ -1,5 +1,5 @@
|
||||
import { useEffect } from "react";
|
||||
import { HashRouter, Routes, Route } from "react-router-dom";
|
||||
import { HashRouter, Routes, Route, useNavigate } from "react-router-dom";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { useAuthStore } from "@/stores/auth-store";
|
||||
import { LoginPage } from "@/features/auth/login-page";
|
||||
@@ -42,9 +42,22 @@ const App = () => {
|
||||
return <AuthenticatedApp />;
|
||||
};
|
||||
|
||||
function AutoplayNavigationListener() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
return window.electronAutoplay.onNavigate((data) => {
|
||||
navigate(`/${data.networkId}/${data.streamId}`);
|
||||
});
|
||||
}, [navigate]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function AuthenticatedApp() {
|
||||
return (
|
||||
<HashRouter>
|
||||
<AutoplayNavigationListener />
|
||||
<Routes>
|
||||
<Route path="settings" element={<SettingsPage />} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user