Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] invalid price defaults to 0tz #415

Open
Zir0h opened this issue May 6, 2024 · 1 comment
Open

[bug] invalid price defaults to 0tz #415

Zir0h opened this issue May 6, 2024 · 1 comment
Labels
🐛 bug Something isn't working 🧹 needs triage The issue/PR was not yet reviewed by a maintainer 🥵 Priority: Critical This should be dealt with ASAP. Not fixing this issue would be a serious error.

Comments

@Zir0h
Copy link
Contributor

Zir0h commented May 6, 2024

Describe the bug

Hey sorry to bother you but my friend told me you’re a teia dev! I just wanted to let you know that I happened to list a piece twice today from the http://teia.art site and both times it was listed at 0 xtz instead of 3.5 as I intended. It’s the second time it happens to me, not a big trouble but I just wanted to let you know in case there might be some sort of bug on the platform. Hope it helps!

-- limbo

Reproduction

swap an objkt for 3,5 tez (hence the comma)
check the rpc call
see that it put 0 as price, and not 3500000

Expected behavior

should abort transaction and show an error

Platform and versions

- Linux
- FF 125.0.1

Console output

2024-05-06-151415_831x135_scrot

NaN with 3,5 as input
3.5 with 3.5 as input

@Zir0h Zir0h added 🐛 bug Something isn't working 🧹 needs triage The issue/PR was not yet reviewed by a maintainer 🥵 Priority: Critical This should be dealt with ASAP. Not fixing this issue would be a serious error. labels May 6, 2024
@Zir0h
Copy link
Contributor Author

Zir0h commented May 6, 2024

diff --git a/src/pages/objkt-display/tabs/Swap.jsx b/src/pages/objkt-display/tabs/Swap.jsx
index 7b751da6..80d4646a 100644
--- a/src/pages/objkt-display/tabs/Swap.jsx
+++ b/src/pages/objkt-display/tabs/Swap.jsx
@@ -69,7 +69,7 @@ export const Swap = () => {
       return
     }
 
-    if (price == null || price < 0) {
+    if (price == null || price < 0 || !price) {
       show(`Please enter a price for the swap (current value: ${price})`)
       return
     }

would catch the "invalid input"

because in the current implementation, if you put "1,1" it gets translated to empty string "" and passes those checks

the onBlur validation doesn't seem to work 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🧹 needs triage The issue/PR was not yet reviewed by a maintainer 🥵 Priority: Critical This should be dealt with ASAP. Not fixing this issue would be a serious error.
Projects
None yet
Development

No branches or pull requests

1 participant