diff --git a/rss-notifier/panel.luau b/rss-notifier/panel.luau index e4aaa7b..2b5d9f8 100644 --- a/rss-notifier/panel.luau +++ b/rss-notifier/panel.luau @@ -56,7 +56,7 @@ itemRow = function(item) }), ui.button({ glyph = "close", - variant = "ghost", + variant = "outline", controlSize = "sm", tooltip = "Dispensar", onClick = function() dismissItem(item) end, @@ -86,10 +86,10 @@ render = function() local headerButtons = {} if #items > 0 then - table.insert(headerButtons, ui.button({ glyph = "trash", variant = "ghost", controlSize = "sm", tooltip = "Limpar tudo", onClick = "onClearAllClicked" })) + table.insert(headerButtons, ui.button({ glyph = "trash", variant = "outline", controlSize = "sm", tooltip = "Limpar tudo", onClick = "onClearAllClicked" })) end - table.insert(headerButtons, ui.button({ glyph = "refresh", variant = "ghost", controlSize = "sm", tooltip = "Atualizar agora", onClick = "onRefreshClicked" })) - table.insert(headerButtons, ui.button({ glyph = "close", variant = "ghost", controlSize = "sm", onClick = "onCloseClicked" })) + table.insert(headerButtons, ui.button({ glyph = "refresh", variant = "outline", controlSize = "sm", tooltip = "Atualizar agora", onClick = "onRefreshClicked" })) + table.insert(headerButtons, ui.button({ glyph = "close", variant = "outline", controlSize = "sm", onClick = "onCloseClicked" })) panel.render(ui.column({ gap = 10, padding = 12, fill = true }, { ui.row({ align = "center", justify = "space_between" }, { @@ -108,6 +108,17 @@ noctalia.state.watch("items", function(raw) end) function onOpen(_context) + -- o painel so e criado na primeira vez que e aberto - se o service ja + -- tinha publicado itens antes disso (ex: na checagem de boot), o watch() + -- sozinho nao pega esse valor antigo. Busca o estado atual na abertura. + local ok, raw = pcall(noctalia.state.get, "items") + if ok and raw then + local decodeOk, decoded = pcall(noctalia.json.decode, raw) + if decodeOk and decoded then + items = decoded + end + end + render() -- abrir o painel conta como "li as novidades": zera o badge no service noctalia.runAsync("noctalia msg plugin nilsonlinux/rss-notifier:fetcher all mark-read") diff --git a/rss-notifier/plugin.toml b/rss-notifier/plugin.toml index 79a0e94..29fa93a 100644 --- a/rss-notifier/plugin.toml +++ b/rss-notifier/plugin.toml @@ -1,6 +1,6 @@ id = "nilsonlinux/rss-notifier" name = "RSS/Atom Notifier" -version = "1.0.0" +version = "1.0.1" plugin_api = 14 author = "Nilsonlinux" license = "MIT" diff --git a/rss-notifier/thumbnail.webp b/rss-notifier/thumbnail.webp index df30766..ff9b0a8 100644 Binary files a/rss-notifier/thumbnail.webp and b/rss-notifier/thumbnail.webp differ