Skip to content

Commit

Permalink
Merge pull request #244 from clins1994/notifications
Browse files Browse the repository at this point in the history
fix(getUser): deal with unexpected notifications structure
  • Loading branch information
clins1994 authored Jul 18, 2024
2 parents 693f205 + b777878 commit 879c125
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/miscRequests.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ module.exports = {
following: parseFloat(/,"following":([0-9]*?),/.exec(data)?.[1] || 0),
followers: parseFloat(/,"followers":([0-9]*?),/.exec(data)?.[1] || 0),
notifications: {
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),
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),
},
session,
signature,
Expand Down

0 comments on commit 879c125

Please sign in to comment.