File tree Expand file tree Collapse file tree 5 files changed +18
-3
lines changed
Expand file tree Collapse file tree 5 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,16 @@ function SimilarQuestions:init(questions)
3636 button :append (fid .. " " , " leetcode_normal" )
3737 button :append (utils .translate (p .title , p .title_cn ))
3838
39- if not config .auth .is_premium and q .paid_only then
40- button :append ((" %s " ):format (config .icons .lock ) .. t (" Premium" ), " leetcode_medium" )
39+ if q .paid_only then
40+ local txt
41+
42+ if config .auth .is_premium then
43+ txt = " " .. config .icons .unlock
44+ else
45+ txt = (" %s " ):format (config .icons .lock ) .. t (" Premium" )
46+ end
47+
48+ button :append (txt , " leetcode_medium" )
4149 end
4250
4351 self :insert (button )
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ function Footer:contents()
1515 self :endgrp ()
1616
1717 self :append (t (" Signed in as" ) .. " : " , " leetcode_alt" )
18+ if config .auth .is_premium then self :append (config .icons .star .. " " , " leetcode_medium" ) end
1819 self :append (config .auth .name ):endl ()
1920 end
2021
Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ function Description:populate()
119119
120120 header :append (q .frontend_id .. " . " , " leetcode_normal" )
121121 header :append (utils .translate (q .title , q .translated_title ))
122+ if q .is_paid_only then header :append (" " .. t (" Premium" ), " leetcode_medium" ) end
122123 header :endgrp ()
123124
124125 local show_stats = self .show_stats
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ local icons = {
33 circle = " " ,
44 square = " " ,
55 lock = " " ,
6+ unlock = " " ,
7+ star = " " ,
68 status = {
79 ac = " " ,
810 notac = " " ,
@@ -17,6 +19,7 @@ icons.hl = {
1719 todo = { icons .status .todo , " leetcode_alt" },
1820 },
1921 lock = { icons .lock , " leetcode_medium" },
22+ unlock = { icons .unlock , " leetcode_medium" },
2023}
2124
2225icons .indent = (" \t %s " ):format (icons .bar )
Original file line number Diff line number Diff line change 3434
3535--- @param question lc.cache.Question
3636local function display_user_status (question )
37- if question .paid_only and not config .auth .is_premium then return config .icons .hl .lock end
37+ if question .paid_only then
38+ return config .auth .is_premium and config .icons .hl .unlock or config .icons .hl .lock
39+ end
3840
3941 if question .status == vim .NIL then return { " " } end
4042 return config .icons .hl .status [question .status ] or { " " }
You can’t perform that action at this time.
0 commit comments