From 75838dd1fc474f0e874cdcc300efb88714f85980 Mon Sep 17 00:00:00 2001 From: koalasat Date: Fri, 18 Jul 2025 12:11:13 +0200 Subject: [PATCH] Logic fixes --- frontend/src/basic/OrderPage/index.tsx | 2 +- frontend/src/basic/RobotPage/RobotProfile.tsx | 78 +++++++++---------- frontend/src/basic/RobotPage/TokenInput.tsx | 4 +- frontend/src/models/Slot.model.ts | 6 +- frontend/static/locales/ca.json | 1 - frontend/static/locales/cs.json | 1 - frontend/static/locales/de.json | 1 - frontend/static/locales/en.json | 1 - frontend/static/locales/es.json | 1 - frontend/static/locales/eu.json | 1 - frontend/static/locales/fr.json | 1 - frontend/static/locales/it.json | 1 - frontend/static/locales/ja.json | 1 - frontend/static/locales/pl.json | 1 - frontend/static/locales/pt.json | 1 - frontend/static/locales/ru.json | 1 - frontend/static/locales/sv.json | 1 - frontend/static/locales/sw.json | 1 - frontend/static/locales/th.json | 1 - frontend/static/locales/zh-SI.json | 1 - frontend/static/locales/zh-TR.json | 1 - 21 files changed, 47 insertions(+), 60 deletions(-) diff --git a/frontend/src/basic/OrderPage/index.tsx b/frontend/src/basic/OrderPage/index.tsx index fcbc0331..d17363fc 100644 --- a/frontend/src/basic/OrderPage/index.tsx +++ b/frontend/src/basic/OrderPage/index.tsx @@ -70,7 +70,7 @@ const OrderPage = (): React.JSX.Element => { return () => { setCurrentOrder(null); }; - }, [params.orderId, openNoRobot]); + }, [params.orderId, openNoRobot, garage.currentSlot]); useEffect(() => { if (!currentOrder) return; diff --git a/frontend/src/basic/RobotPage/RobotProfile.tsx b/frontend/src/basic/RobotPage/RobotProfile.tsx index a5d0aace..d62ee9ef 100644 --- a/frontend/src/basic/RobotPage/RobotProfile.tsx +++ b/frontend/src/basic/RobotPage/RobotProfile.tsx @@ -6,13 +6,13 @@ import { Grid, LinearProgress, Typography, - Alert, Select, MenuItem, Box, useTheme, type SelectChangeEvent, IconButton, + Tooltip, } from '@mui/material'; import { Key, Bolt, Add, DeleteSweep, Download, Settings } from '@mui/icons-material'; import RobotAvatar from '../../components/RobotAvatar'; @@ -158,7 +158,8 @@ const RobotProfile = ({ - {robot?.found && Boolean(slot?.lastOrder?.id) ? ( - - {t('Welcome back!')} - - ) : ( - <> - )} - {federation.loading && !slot?.activeOrder?.id ? ( + {federation.loading && !slot?.activeOrder && !slot?.lastOrder ? ( {t('Looking for orders!')} @@ -202,7 +202,7 @@ const RobotProfile = ({ ) : null} - {!slot?.activeOrder?.id && Boolean(slot?.lastOrder?.id) ? ( + {!slot?.activeOrder && slot?.lastOrder ? (