Skip to content

Commit

Permalink
Code cleanup (#719)
Browse files Browse the repository at this point in the history
- Remove random call to `print`
- Remove double declaration of notifdService
  • Loading branch information
davfsa authored Jan 13, 2025
1 parent fab3a8c commit 636f031
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/components/bar/modules/notifications/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 636f031

Please sign in to comment.