From 3e0042d2ec050b61982233f1518995010809a6ab Mon Sep 17 00:00:00 2001 From: koalasat Date: Fri, 25 Apr 2025 10:06:49 +0200 Subject: [PATCH] Frontend 2 --- .../TradeBox/Prompts/Successful.tsx | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/TradeBox/Prompts/Successful.tsx b/frontend/src/components/TradeBox/Prompts/Successful.tsx index eeeb5971..9c347f4e 100644 --- a/frontend/src/components/TradeBox/Prompts/Successful.tsx +++ b/frontend/src/components/TradeBox/Prompts/Successful.tsx @@ -50,6 +50,7 @@ export const SuccessfulPrompt = ({ const [coordinatorToken, setCoordinatorToken] = useState(); const [hostRating, setHostRating] = useState(); + const [tokenError, setTokenError] = useState(false); const rateHostPlatform = function (): void { if (!hostRating) return; @@ -57,13 +58,12 @@ export const SuccessfulPrompt = ({ const slot = garage.getSlot(); const coordinatorPubKey = federation.getCoordinator(order.shortAlias)?.nostrHexPubkey; - if ( - !coordinatorToken || - !slot?.nostrPubKey || - !slot.nostrSecKey || - !coordinatorPubKey || - !order.id - ) { + if (!coordinatorToken) { + setTokenError(true); + return; + } + + if (!slot?.nostrPubKey || !slot.nostrSecKey || !coordinatorPubKey || !order.id) { setHostRating(0); return; } @@ -131,6 +131,13 @@ export const SuccessfulPrompt = ({ + {tokenError && ( + + + {t("Error obatining coordinator' s token.")} + + + )}