File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ function Auth.handle(res, err)
3636 err = {}
3737
3838 if (not config .is_cn and auth .id == vim .NIL ) or (config .is_cn and auth .slug == vim .NIL ) then
39- err .msg = " Session expired?"
39+ err .msg = " Cookie expired?"
4040 elseif not auth .is_signed_in then
4141 err .msg = " Sign-in failed"
4242 elseif not auth .is_verified then
Original file line number Diff line number Diff line change @@ -135,9 +135,16 @@ function statistics.streak(cb)
135135 if err then
136136 return cb (nil , err )
137137 end
138+
138139 local data = res .data
139140 local streak = data [" streakCounter" ]
140- cb (streak )
141+
142+ if streak == vim .NIL then
143+ err = { msg = " Failed to load streak counter" }
144+ cb (nil , err )
145+ else
146+ cb (streak )
147+ end
141148 end ,
142149 })
143150end
Original file line number Diff line number Diff line change @@ -151,8 +151,9 @@ function utils.check_err(err)
151151
152152 if err .status then
153153 if err .status == 401 or err .status == 403 then
154- require (" leetcode.command" ).expire ()
155- err .msg = " Session expired? Enter a new cookie to keep using `leetcode.nvim`"
154+ -- require("leetcode.command").expire()
155+ err .msg =
156+ " Your cookie may have expired, or LeetCode has temporarily restricted API access"
156157 end
157158 end
158159
You can’t perform that action at this time.
0 commit comments