From 20466223cf805c5242dfcaa7964b818a677e730b Mon Sep 17 00:00:00 2001 From: davfsa Date: Sun, 12 Jan 2025 19:13:25 +0100 Subject: [PATCH] Code cleanup - Remove random call to `print` - Remove double declaration of notifdService --- src/components/bar/modules/notifications/index.tsx | 7 +++---- src/lib/utils.ts | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/bar/modules/notifications/index.tsx b/src/components/bar/modules/notifications/index.tsx index aa91f55d8..bf8d278fd 100644 --- a/src/components/bar/modules/notifications/index.tsx +++ b/src/components/bar/modules/notifications/index.tsx @@ -7,12 +7,11 @@ import { BarBoxChild } from 'src/lib/types/bar.js'; import { runAsyncCommand, throttledScrollHandler } from 'src/components/bar/utils/helpers.js'; import { bind, Variable } from 'astal'; import { onMiddleClick, onPrimaryClick, onScroll, onSecondaryClick } from 'src/lib/shared/eventHandlers'; +import { notifdService } from 'src/lib/constants/services'; const { show_total, rightClick, middleClick, scrollUp, scrollDown, hideCountWhenZero } = options.bar.notifications; const { ignore } = options.notifications; -const notifs = AstalNotifd.get_default(); - export const Notifications = (): BarBoxChild => { const componentClassName = Variable.derive( [bind(options.theme.bar.buttons.style), bind(show_total)], @@ -29,8 +28,8 @@ export const Notifications = (): BarBoxChild => { const boxChildren = Variable.derive( [ - bind(notifs, 'notifications'), - bind(notifs, 'dontDisturb'), + bind(notifdService, 'notifications'), + bind(notifdService, 'dontDisturb'), bind(show_total), bind(ignore), bind(hideCountWhenZero), diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 898d91811..902d2b294 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -99,7 +99,7 @@ export function icon(name: string | null, fallback = icons.missing): string { if (lookUpIcon(icon)) return icon; - print(`no icon substitute "${icon}" for "${name}", fallback: "${fallback}"`); + console.log(`no icon substitute "${icon}" for "${name}", fallback: "${fallback}"`); return fallback; }