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

GetUser function error on notification count parsing #243

Open
nepomucen-s opened this issue Jun 28, 2024 · 2 comments
Open

GetUser function error on notification count parsing #243

nepomucen-s opened this issue Jun 28, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@nepomucen-s
Copy link

Hi, there are issues with the following lines. It seems that TradingView now returns an empty object {} instead of a 0 when there are no new notifications. Maybe an error on their side, or maybe they changed their API. At least that's how it works for me now.

If anybody has a problem with that, just remove the parsing and fixate it to 0 (unless you use this data ofc), like this:

notifications: {
  following: 0,
  user: 0
},

following: parseFloat(/"notification_count":\{"following":([0-9]*),/.exec(data)?.[1] || 0),

user: parseFloat(/"notification_count":\{"following":[0-9]*,"user":([0-9]*)/.exec(data)?.[1] || 0),

@clins1994
Copy link
Collaborator

clins1994 commented Jun 28, 2024

@nepomucen-s thanks for the report man. could you try running this to see if it fixes your issue? #244

if you can provide the example response and screenshot of the successful test that'd be great

once we have that, we can merge the fix

@clins1994 clins1994 self-assigned this Jun 28, 2024
@clins1994 clins1994 added the bug Something isn't working label Jun 28, 2024
@clins1994
Copy link
Collaborator

merged the fix. thank you @nepomucen-s for reporting it. i will check how to release it. will keep you posted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants