Code cleanup (#719)

- Remove random call to `print`
- Remove double declaration of notifdService
This commit is contained in:
davfsa
2025-01-13 08:53:32 +01:00
committed by GitHub
parent fab3a8c3a1
commit 636f031b77
2 changed files with 4 additions and 5 deletions

View File

@@ -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),

View File

@@ -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;
}