From 8d4c6bc830c84bc1b6790250695083b998dffa0d Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Thu, 10 Apr 2025 20:30:18 +1000
Subject: headlines: enable button
Also disable news from no api key notif
---
src/modules/sidebar/modules/headlines.tsx | 7 ++++++-
src/services/news.ts | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
(limited to 'src')
diff --git a/src/modules/sidebar/modules/headlines.tsx b/src/modules/sidebar/modules/headlines.tsx
index 462e2ee..40d468b 100644
--- a/src/modules/sidebar/modules/headlines.tsx
+++ b/src/modules/sidebar/modules/headlines.tsx
@@ -5,6 +5,7 @@ import { capitalize } from "@/utils/strings";
import { bind, execAsync, Variable } from "astal";
import { Gtk } from "astal/gtk3";
import { sidebar } from "config";
+import { setConfig } from "config/funcs";
const fixGoogleNews = (colours: IPalette, title: string, desc: string) => {
// Add separator, bold and split at domain (domain is at the end of each headline)
@@ -153,7 +154,11 @@ const HeadlinesDisabled = () => (
-
+
diff --git a/src/services/news.ts b/src/services/news.ts
index e5f605d..14c980c 100644
--- a/src/services/news.ts
+++ b/src/services/news.ts
@@ -1,6 +1,7 @@
import { notify } from "@/utils/system";
import { execAsync, GLib, GObject, property, readFileAsync, register, writeFileAsync } from "astal";
import { news as config } from "config";
+import { setConfig } from "config/funcs";
export interface IArticle {
title: string;
@@ -55,6 +56,7 @@ export default class News extends GObject.Object {
urgency: "critical",
actions: {
"Get API key": () => execAsync("app2unit -O -- https://newsdata.io").catch(console.error),
+ Disable: () => setConfig("sidebar.modules.headlines.enabled", false),
},
});
this.#notified = true;
--
cgit v1.2.3-freya