fix duplicate birthday entries #27
@@ -44,12 +44,21 @@ function redraw()
|
|||||||
events = {}
|
events = {}
|
||||||
local lines = {}
|
local lines = {}
|
||||||
for i,v in ipairs(contacts) do
|
for i,v in ipairs(contacts) do
|
||||||
|
local fmt_out = fmt_line(v)
|
||||||
|
local insert = 0
|
||||||
|
if #lines == 0 then
|
||||||
|
insert = 1
|
||||||
|
elseif not (fmt_out == lines[#lines]) then
|
||||||
|
insert = 1
|
||||||
|
end
|
||||||
|
if insert == 1 then
|
||||||
table.insert(events, v)
|
table.insert(events, v)
|
||||||
table.insert(lines, fmt_line(v))
|
table.insert(lines, fmt_out)
|
||||||
if i == prefs.count then
|
if #lines == prefs.count then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
ui:show_lines(lines)
|
ui:show_lines(lines)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user