fix: provide an option for not showing the expired window when gettin… #112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…g 401/403
This is a suggested temprary fix for http 401/403 error from leetcode.
I found that the current leetcode api only reject some of the requests. It's often the case that leetcode returns 403 for some requests but still accept some other requests after that. Treating all the 403 requests as expired just made the entire plugin unusable.
I added and
show_menu_when_expire
option to the config template. When setting this flag to false, the system will only pop an error instead of call thecmd.menu()
andcmd.cookie_prompt()
to send the user all the way back to the main menu.I suspect that most of the 403 we got recently is because of the change of leetcode api. I think reseving this option is also important for leetcode.nvim to handle future api change. Otherwise, a simple api change may disbale the entire plugin.