From f28b5a3a26357458336da83be1bf3dfef2636800 Mon Sep 17 00:00:00 2001 From: HannahPadd Date: Fri, 27 Feb 2026 16:02:30 +0100 Subject: [PATCH] Should be mostly good now --- gui/src/App.tsx | 7 +++-- gui/src/AppLayout.tsx | 8 +++-- gui/src/components/TopBar.tsx | 3 -- .../components/onboarding/UdevRulesModal.tsx | 31 +++++++++++-------- .../pages/ErrorCollectingConstent.tsx | 1 - gui/src/utils/sentry.ts | 2 +- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/gui/src/App.tsx b/gui/src/App.tsx index aadd7c06e..b30a3ed40 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -17,7 +17,7 @@ import { AutomaticProportionsPage } from './components/onboarding/pages/body-pro import { ManualProportionsPage } from './components/onboarding/pages/body-proportions/ManualProportions'; import { ConnectTrackersPage } from './components/onboarding/pages/ConnectTracker'; import { HomePage } from './components/onboarding/pages/Home'; -import { ErrorCollectingConsentPage } from './components/onboarding/pages/ErrorCollectingConstent' +import { ErrorCollectingConsentPage } from './components/onboarding/pages/ErrorCollectingConstent'; import { AutomaticMountingPage } from './components/onboarding/pages/mounting/AutomaticMounting'; import { ManualMountingPage } from './components/onboarding/pages/mounting/ManualMounting'; import { TrackersAssignPage } from './components/onboarding/pages/trackers-assign/TrackerAssignment'; @@ -150,7 +150,10 @@ function Layout() { } > } /> - } /> + } + /> } /> } /> } /> diff --git a/gui/src/AppLayout.tsx b/gui/src/AppLayout.tsx index c5f9e56fc..ab067c3a9 100644 --- a/gui/src/AppLayout.tsx +++ b/gui/src/AppLayout.tsx @@ -4,7 +4,7 @@ import { Outlet, useLocation, useNavigate } from 'react-router-dom'; export function AppLayout() { const { config } = useConfig(); - const { pathname } = useLocation() + const { pathname } = useLocation(); const navigate = useNavigate(); useLayoutEffect(() => { @@ -29,7 +29,11 @@ export function AppLayout() { }, [config]); useLayoutEffect(() => { - if (config && !config.doneOnboarding && !pathname.startsWith('/onboarding/')) { + if ( + config && + !config.doneOnboarding && + !pathname.startsWith('/onboarding/') + ) { navigate('/onboarding/home'); } }, [config]); diff --git a/gui/src/components/TopBar.tsx b/gui/src/components/TopBar.tsx index fa29714f4..f2f4c5715 100644 --- a/gui/src/components/TopBar.tsx +++ b/gui/src/components/TopBar.tsx @@ -22,8 +22,6 @@ import { GearIcon } from './commons/icon/GearIcon'; import { TrackersStillOnModal } from './TrackersStillOnModal'; import { useConfig } from '@/hooks/config'; import { TrayOrExitModal } from './TrayOrExitModal'; -import { ErrorConsentModal } from './ErrorConsentModal'; -import { UdevRulesModal } from './onboarding/UdevRulesModal'; import { useAtomValue } from 'jotai'; import { connectedIMUTrackersAtom } from '@/store/app-store'; import { useElectron } from '@/hooks/electron'; @@ -137,7 +135,6 @@ export function TopBar({ } ); - return ( <>
diff --git a/gui/src/components/onboarding/UdevRulesModal.tsx b/gui/src/components/onboarding/UdevRulesModal.tsx index 9d1d29a00..c44d7e4bf 100644 --- a/gui/src/components/onboarding/UdevRulesModal.tsx +++ b/gui/src/components/onboarding/UdevRulesModal.tsx @@ -7,7 +7,6 @@ import { useElectron } from '@/hooks/electron'; import { useWebsocketAPI } from '@/hooks/websocket-api'; import { RpcMessage, InstalledInfoResponseT } from 'solarxr-protocol'; import { useConfig } from '@/hooks/config'; -import { error } from '@/utils/logging'; export function UdevRulesModal() { const { config, setConfig } = useConfig(); @@ -20,18 +19,19 @@ export function UdevRulesModal() { const [dontShowAgain, setDontShowAgain] = useState(false); const [exeDir, setExeDir] = useState(''); - const handleUdevContent = async () => { if (electron.isElectron) { - const dir = await electron.api.getInstallDir() + const dir = await electron.api.getInstallDir(); setExeDir(dir); const rulesDir = `${exeDir}/69-slimevr-devices.rules`; - setUdevContent(`cat ${rulesDir} | sudo tee /etc/udev/rules.d/69-slimevr-devices.rules pn>/dev/null`); + setUdevContent( + `cat ${rulesDir} | sudo tee /etc/udev/rules.d/69-slimevr-devices.rules pn>/dev/null` + ); } - } + }; useEffect(() => { - handleUdevContent() + handleUdevContent(); }, [exeDir]); useEffect(() => { @@ -41,7 +41,8 @@ export function UdevRulesModal() { const udevMissing = !isUdevInstalledResponse; const notHiddenGlobally = !config.dontShowUdevModal; const notHiddenThisSession = !dontShowThisSession; - const shouldShow = isLinux && udevMissing && notHiddenGlobally && notHiddenThisSession; + const shouldShow = + isLinux && udevMissing && notHiddenGlobally && notHiddenThisSession; if (shouldShow) { setShowUdevWarning(true); } else { @@ -66,26 +67,30 @@ export function UdevRulesModal() { const handleModalCose = () => { if (!config) throw 'Invalid State!'; - setConfig({dontShowUdevModal: dontShowAgain}); + setConfig({ dontShowUdevModal: dontShowAgain }); setDontShowThisSession(true); - } + }; const copyToClipboard = () => { navigator.clipboard.writeText(udevContent); }; - return (
- - + +
- +
{udevContent}
diff --git a/gui/src/components/onboarding/pages/ErrorCollectingConstent.tsx b/gui/src/components/onboarding/pages/ErrorCollectingConstent.tsx index 6c8779ac7..67b7c7776 100755 --- a/gui/src/components/onboarding/pages/ErrorCollectingConstent.tsx +++ b/gui/src/components/onboarding/pages/ErrorCollectingConstent.tsx @@ -29,7 +29,6 @@ export function ErrorCollectingConsentPage() { > -