-
Notifications
You must be signed in to change notification settings - Fork 3
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 - yourRate is sometimes parsed incorrectly #1
Comments
Thanks for bringing this up. |
Just out of curiosity, what IDE are you using here and how are you doing the debugging for the script as it would need to run in a browser wouldn't it? I mostly just used console.log() for my debugging as I don't have much experience with JavaScript and learned to build this extension |
Yeah the effect should be very small... I actually started looking into it because I noticed a large discrepancy in my "your deposits in this pool" number on a pool after a long while of having the page open and then clicking the extension to refresh...it would be a few percent too high...reloading the page and clicking the extension again corrected the value. I'm still trying to isolate that bug. |
I was just using the Chrome dev tools (Sources tab) debugger...much handier than adding console statements! |
@grepole121 I believe the main issue I noticed with occasional wrong deposit amounts is because once the extension has overwritten the textContent of the "your rate" line (to include the dollar amount), the UI no longer updates that cell with new rate info. Maybe append/update a new div with the dollar amount instead? Might fix it. |
So QuickSwap doesn't update "Your rate" part of the website after the script runs and puts the dollar equivalent in brackets? |
Yeah, I believe that's what's happening. I didn't test it too much but that's what it looked like to me. On one tab I ran the extension once and then let it sit there as Quickswap updated values. On another tab I opened the same page but didn't trigger the extension, and the rate values there updated while the previous tab's rate values remained the same. |
quickswap_apy/displayAPYs.js
Line 74 in 5524cb5
Since this particular element may contain the extension-injected dollar amount in parentheses, the regex isn't enough to parse the quick amount, and so it can end up including some of the digits from the dollar amount:
The text was updated successfully, but these errors were encountered: