diff --git a/lua/leetcode/api/utils.lua b/lua/leetcode/api/utils.lua index 01210743..166d86c8 100644 --- a/lua/leetcode/api/utils.lua +++ b/lua/leetcode/api/utils.lua @@ -151,7 +151,7 @@ function utils.check_err(err) end if err.status then - if err.status == 401 or err.status == 403 then + if (err.status == 401 or err.status == 403) and config.user.show_menu_when_expire then require("leetcode.command").expire() err.msg = "Session expired? Enter a new cookie to keep using `leetcode.nvim`" end diff --git a/lua/leetcode/config/template.lua b/lua/leetcode/config/template.lua index 27590e0b..600450d8 100644 --- a/lua/leetcode/config/template.lua +++ b/lua/leetcode/config/template.lua @@ -127,6 +127,9 @@ local M = { ---@type boolean image_support = false, + + ---@type boolean + show_menu_when_expire = false, } return M