From b78734d872a9a54aa3bb04c8c3e4fa7f9ae1d1d9 Mon Sep 17 00:00:00 2001 From: koalasat Date: Tue, 8 Apr 2025 12:27:05 +0200 Subject: [PATCH] Remove spaces in reovery token --- frontend/src/basic/RobotPage/TokenInput.tsx | 2 +- frontend/src/basic/RobotPage/index.tsx | 2 +- frontend/src/components/Dialogs/Recovery.tsx | 2 +- frontend/src/components/TradeBox/index.tsx | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/basic/RobotPage/TokenInput.tsx b/frontend/src/basic/RobotPage/TokenInput.tsx index 06d4a355..ba21f5f4 100644 --- a/frontend/src/basic/RobotPage/TokenInput.tsx +++ b/frontend/src/basic/RobotPage/TokenInput.tsx @@ -75,7 +75,7 @@ const TokenInput = ({ helperText={badToken} size='medium' onChange={(e) => { - setInputToken(e.target.value); + setInputToken(e.target.value.replace(/\s+/g, '')); }} onKeyPress={(e) => { if (e.key === 'Enter') { diff --git a/frontend/src/basic/RobotPage/index.tsx b/frontend/src/basic/RobotPage/index.tsx index 963f6cd1..6cc8d5a5 100644 --- a/frontend/src/basic/RobotPage/index.tsx +++ b/frontend/src/basic/RobotPage/index.tsx @@ -38,7 +38,7 @@ const RobotPage = (): JSX.Element => { useEffect(() => { const token = urlToken ?? garage.currentSlot; if (token !== undefined && token !== null && page === 'garage') { - setInputToken(token); + setInputToken(token.replace(/\s+/g, '')); if (client !== 'mobile' || torStatus === 'ON' || !settings.useProxy) { setView('profile'); } diff --git a/frontend/src/components/Dialogs/Recovery.tsx b/frontend/src/components/Dialogs/Recovery.tsx index b97f6d5d..52efda47 100644 --- a/frontend/src/components/Dialogs/Recovery.tsx +++ b/frontend/src/components/Dialogs/Recovery.tsx @@ -26,7 +26,7 @@ const RecoveryDialog = ({ setInputToken, setView }: Props): JSX.Element => { const onClickRecover = (): void => { void garage.createRobot(federation, recoveryToken); - setInputToken(recoveryToken.trim()); + setInputToken(recoveryToken); setView('profile'); setOpen((open) => { return { ...open, recovery: false }; diff --git a/frontend/src/components/TradeBox/index.tsx b/frontend/src/components/TradeBox/index.tsx index 4cb85261..a46eed40 100644 --- a/frontend/src/components/TradeBox/index.tsx +++ b/frontend/src/components/TradeBox/index.tsx @@ -190,7 +190,7 @@ const TradeBox = ({ currentOrder, onStartAgain }: TradeBoxProps): JSX.Element => mining_fee_rate, statement, rating, - cancel_status + cancel_status, }: SubmitActionProps): void { const slot = garage.getSlot(); @@ -204,7 +204,7 @@ const TradeBox = ({ currentOrder, onStartAgain }: TradeBoxProps): JSX.Element => mining_fee_rate, statement, rating, - cancel_status + cancel_status, }) .then((data: Order) => { setOpen(closeAll); @@ -231,8 +231,8 @@ const TradeBox = ({ currentOrder, onStartAgain }: TradeBoxProps): JSX.Element => setLoadingButtons({ ...noLoadingButtons, cancel: true }); submitAction({ - action: 'cancel', - cancel_status: noConfirmation ? order?.status : undefined + action: 'cancel', + cancel_status: noConfirmation ? order?.status : undefined, }); };