Merge pull request #1848 from RoboSats/remove-spaces-in-recovery-token

Remove spaces in recovery token
This commit is contained in:
KoalaSat
2025-04-08 10:32:30 +00:00
committed by GitHub
4 changed files with 7 additions and 7 deletions

View File

@ -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') {

View File

@ -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');
}

View File

@ -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 };

View File

@ -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);
@ -232,7 +232,7 @@ const TradeBox = ({ currentOrder, onStartAgain }: TradeBoxProps): JSX.Element =>
setLoadingButtons({ ...noLoadingButtons, cancel: true });
submitAction({
action: 'cancel',
cancel_status: noConfirmation ? order?.status : undefined
cancel_status: noConfirmation ? order?.status : undefined,
});
};