From 6ab87becb59a9ee82ab512ea0da37e57a4bed2dc Mon Sep 17 00:00:00 2001 From: Sora Liu Date: Mon, 30 Nov 2020 20:38:29 +0800 Subject: [PATCH] fix(getUserInfo): using userStatus.isPremium --- lib/plugins/leetcode.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/plugins/leetcode.js b/lib/plugins/leetcode.js index c403582d..cba6c87a 100644 --- a/lib/plugins/leetcode.js +++ b/lib/plugins/leetcode.js @@ -408,7 +408,9 @@ plugin.getUserInfo = function(cb) { '{', ' user {', ' username', - ' isCurrentUserPremium', + ' }', + ' userStatus {', + ' isPremium', ' }', '}' ].join('\n'), @@ -422,7 +424,8 @@ plugin.getUserInfo = function(cb) { if (e) return cb(e); const user = body.data.user; - return cb(null, user); + const userStatus = body.data.userStatus; + return cb(null, user, userStatus); }); }; @@ -514,9 +517,9 @@ plugin.getUser = function(user, cb) { log.warn('Failed to retrieve user favorites: ' + e); } - plugin.getUserInfo(function(e, _user) { + plugin.getUserInfo(function(e, _user, _userStatus) { if (!e) { - user.paid = _user.isCurrentUserPremium; + user.paid = _userStatus.isPremium user.name = _user.username; } session.saveUser(user); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy