Fix found bugs during demo

This commit is contained in:
Dave Richer
2023-12-12 13:38:23 -05:00
parent fe80256a40
commit 95c9978ee7
8 changed files with 96 additions and 97 deletions

View File

@@ -68,7 +68,6 @@ export function TechPage({ technician }) {
<Layout>
<UpdateAlert />
<TechHeader />
<Content className="tech-content-container">
<ErrorBoundary>
<Suspense
@@ -82,7 +81,7 @@ export function TechPage({ technician }) {
<PrintCenterModalContainer />
<Routes>
<Route path='/login' element={<TechLogin />} />
<Route path='/joblokup' element={<TechLookup />} />
<Route path='/joblookup' element={<TechLookup />} />
<Route path='/list' element={<ProductionListPage />} />
<Route path='/jobclock' element={<TechJobClock />} />
<Route path='/shiftclock' element={<TechShiftClock />} />
@@ -91,7 +90,6 @@ export function TechPage({ technician }) {
</FeatureWrapper>
</Suspense>
</ErrorBoundary>
<BackTop />
</Content>
</Layout>

View File

@@ -25,10 +25,12 @@ export function TechPageContainer({ bodyshop, setBodyshop }) {
nextFetchPolicy: "network-only",
});
const { t } = useTranslation();
useEffect(() => {
if (data) setBodyshop(data.bodyshops[0]);
}, [data, setBodyshop]);
if (loading || !bodyshop)
return <LoadingSpinner message={t("general.labels.loadingshop")} />;
if (error) return <AlertComponent message={error.message} type="error" />;