Fix loading robots (#1166)

* Fix loading Robot orders

* remove logs

* feat: move looking for orders loading bar

---------

Co-authored-by: KoalaSat <yv1vtrul@duck.com>
This commit is contained in:
Reckless_Satoshi 2024-03-09 15:53:04 +00:00 committed by GitHub
parent 2d927249cd
commit e26435f4f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 54 additions and 0 deletions

View File

@ -75,6 +75,10 @@ const RobotProfile = ({
const slot = garage.getSlot();
const robot = slot?.getRobot();
const loadingCoordinators = Object.values(slot?.robots ?? {}).filter(
(robot) => robot.loading,
).length;
return (
<Grid container direction='column' alignItems='center' spacing={1} padding={1} paddingTop={2}>
<Grid
@ -150,6 +154,13 @@ const RobotProfile = ({
)}
</Grid>
{loadingCoordinators > 0 ? (
<Grid>
<b>{t('Looking for orders!')}</b>
<LinearProgress />
</Grid>
) : null}
{Boolean(robot?.activeOrderId) && Boolean(slot?.hashId) ? (
<Grid item>
<Button
@ -197,6 +208,13 @@ const RobotProfile = ({
</Grid>
) : null}
{!Boolean(robot?.activeOrderId) &&
slot?.hashId &&
!Boolean(robot?.lastOrderId) &&
loadingCoordinators === 0 ? (
<Grid item>{t('No existing orders found')}</Grid>
) : null}
<Grid
item
container

View File

@ -324,6 +324,8 @@ export class Coordinator {
if (!hasEnoughEntropy) return null;
garage.updateRobot(token, this.shortAlias, { loading: true });
const newAttributes = await apiClient
.get(this.url, `${this.basePath}/api/robot/`, authHeaders)
.then((data: any) => {

View File

@ -53,6 +53,8 @@
"Delete Garage": "Esborrar Garatge",
"Last order #{{orderID}}": "Última ordre #{{orderID}}",
"Logout": "Sortir",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "La reutilització de la identitat de trading degrada la teva privadesa davant d'altres usuaris, coordinadors i observadors.",
"Robot Garage": "Garatge de Robots",
"Store your token safely": "Guarda el teu token de manera segura",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "Ulož si svůj token bezpečně",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "Verwahre deinen Token sicher",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "Store your token safely",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Borrar Garaje",
"Last order #{{orderID}}": "Última orden #{{orderID}}",
"Logout": "Cerrar sesión",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reutilizar una identidad debilita su privacidad frente a otros usarios, coordinadores y observadores.",
"Robot Garage": "Garaje de robots",
"Store your token safely": "Guarda tu token de forma segura",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "Gorde zure tokena era seguru batean",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Suppression du garage",
"Last order #{{orderID}}": "Dernier ordre #{{orderID}}",
"Logout": "Déconnexion",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "La réutilisation de l'identité d'échange dégrade votre vie privée par rapport aux autres utilisateurs, coordinateurs et observateurs.",
"Robot Garage": "Garage des robots",
"Store your token safely": "Stockez votre jeton en sécurité",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Cancella Garage",
"Last order #{{orderID}}": "Ultimo ordine #{{orderID}}",
"Logout": "Esci",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Il riutilizzo di identità per gli scambi riduce la privacy rispetto ad altri utenti, coordinatori e osservatori.",
"Robot Garage": "Garage del robot",
"Store your token safely": "Custodisci il tuo token in modo sicuro",

View File

@ -53,6 +53,8 @@
"Delete Garage": "ガレージを空にする",
"Last order #{{orderID}}": "直前の注文 #{{orderID}}",
"Logout": "ログアウト",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "同一の身元を再利用することは、他のユーザー、管理者、観察者に対してプライバシーを弱める可能性があります。",
"Robot Garage": "ロボットガレージ",
"Store your token safely": "安全にトークンを保存してください。",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "Przechowuj swój token bezpiecznie",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "Guarde seu token de forma segura",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Удалить гараж",
"Last order #{{orderID}}": "Последний ордер #{{orderID}}",
"Logout": "Выйти",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Повторное использование торговых данных ухудшает вашу конфиденциальность по отношению к другим пользователям, координаторам и наблюдателям.",
"Robot Garage": "Гараж роботов",
"Store your token safely": "Храните Ваш токен в безопасности",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "Spara din token säkert",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Futa Ghorofa",
"Last order #{{orderID}}": "Amri ya mwisho #{{orderID}}",
"Logout": "Toka",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Kutumia tena utambulisho wa biashara hupunguza faragha yako dhidi ya watumiaji wengine, waongozaji na waangalizi.",
"Robot Garage": "Gorofa ya Roboti",
"Store your token safely": "Hifadhi alama yako kwa usalama",

View File

@ -53,6 +53,8 @@
"Delete Garage": "Delete Garage",
"Last order #{{orderID}}": "Last order #{{orderID}}",
"Logout": "Logout",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "Reusing trading identity degrades your privacy against other users, coordinators and observers.",
"Robot Garage": "Robot Garage",
"Store your token safely": "รักษา token ของคุณไว้ให้ดี",

View File

@ -53,6 +53,8 @@
"Delete Garage": "删除仓库",
"Last order #{{orderID}}": "上一张订单 #{{orderID}}",
"Logout": "登出",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "重复使用交易身份会降低你相对其他用户、协调器和观察者的隐私。",
"Robot Garage": "机器人仓库",
"Store your token safely": "请安全地存储你的令牌",

View File

@ -53,6 +53,8 @@
"Delete Garage": "刪除倉庫",
"Last order #{{orderID}}": "上一張訂單 #{{orderID}}",
"Logout": "登出",
"Looking for orders!": "Looking for orders!",
"No existing orders found": "No existing orders found",
"Reusing trading identity degrades your privacy against other users, coordinators and observers.": "重複使用交易身份會降低你對其他用戶、協調器和觀察者的隱私。",
"Robot Garage": "機器人倉庫",
"Store your token safely": "請安全地存儲你的令牌",