Skip to content

Commit 97ffdeb

Browse files
committed
fix: todo state in notifications
1 parent b6d14eb commit 97ffdeb

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lua/orgmode/notifications/init.lua

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ function Notifications:notify(time)
5151

5252
local result = {}
5353
for _, task in ipairs(tasks) do
54+
local todo
55+
if task.todo ~= nil then
56+
todo = task.todo
57+
else
58+
todo = ''
59+
end
5460
utils.concat(result, {
5561
string.format('# %s (%s)', task.category, task.humanized_duration),
56-
string.format('%s %s %s', string.rep('*', task.level), task.todo, task.title),
62+
string.format('%s %s %s', string.rep('*', task.level), todo, task.title),
5763
string.format('%s: <%s>', task.type, task.time:to_string()),
5864
})
5965
end
@@ -76,8 +82,14 @@ end
7682
---@param tasks table[]
7783
function Notifications:_cron_notifier(tasks)
7884
for _, task in ipairs(tasks) do
85+
local todo
86+
if task.todo ~= nil then
87+
todo = task.todo
88+
else
89+
todo = ''
90+
end
7991
local title = string.format('%s (%s)', task.category, task.humanized_duration)
80-
local subtitle = string.format('%s %s %s', string.rep('*', task.level), task.todo, task.title)
92+
local subtitle = string.format('%s %s %s', string.rep('*', task.level), todo, task.title)
8193
local date = string.format('%s: %s', task.type, task.time:to_string())
8294

8395
if vim.fn.executable('notify-send') == 1 then

0 commit comments

Comments
 (0)