Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Fix todo status handling #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/leetcode/api/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function utils.normalize_problems(problems)

return vim.tbl_map(function(p)
return {
status = p.status,
status = p.status == vim.NIL and "todo" or p.status, -- api returns nil for todo
id = p.stat.question_id,
frontend_id = p.stat.frontend_question_id,
title = p.stat.question__title,
Expand Down
2 changes: 1 addition & 1 deletion lua/leetcode/config/icons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ icons.hl = {
status = {
ac = { icons.status.ac, "leetcode_easy" },
notac = { icons.status.notac, "leetcode_medium" },
todo = { icons.status.todo, "leetcode_alt" },
-- todo = { icons.status.todo, "leetcode_alt" },
},
lock = { icons.lock, "leetcode_medium" },
unlock = { icons.unlock, "leetcode_medium" },
Expand Down
3 changes: 0 additions & 3 deletions lua/leetcode/pickers/question.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ local function display_user_status(question)
return config.auth.is_premium and config.icons.hl.unlock or config.icons.hl.lock
end

if question.status == vim.NIL then
return { "" }
end
return config.icons.hl.status[question.status] or { "" }
end

Expand Down