Code cleanup (#719)
- Remove random call to `print` - Remove double declaration of notifdService
This commit is contained in:
@@ -7,12 +7,11 @@ import { BarBoxChild } from 'src/lib/types/bar.js';
|
|||||||
import { runAsyncCommand, throttledScrollHandler } from 'src/components/bar/utils/helpers.js';
|
import { runAsyncCommand, throttledScrollHandler } from 'src/components/bar/utils/helpers.js';
|
||||||
import { bind, Variable } from 'astal';
|
import { bind, Variable } from 'astal';
|
||||||
import { onMiddleClick, onPrimaryClick, onScroll, onSecondaryClick } from 'src/lib/shared/eventHandlers';
|
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 { show_total, rightClick, middleClick, scrollUp, scrollDown, hideCountWhenZero } = options.bar.notifications;
|
||||||
const { ignore } = options.notifications;
|
const { ignore } = options.notifications;
|
||||||
|
|
||||||
const notifs = AstalNotifd.get_default();
|
|
||||||
|
|
||||||
export const Notifications = (): BarBoxChild => {
|
export const Notifications = (): BarBoxChild => {
|
||||||
const componentClassName = Variable.derive(
|
const componentClassName = Variable.derive(
|
||||||
[bind(options.theme.bar.buttons.style), bind(show_total)],
|
[bind(options.theme.bar.buttons.style), bind(show_total)],
|
||||||
@@ -29,8 +28,8 @@ export const Notifications = (): BarBoxChild => {
|
|||||||
|
|
||||||
const boxChildren = Variable.derive(
|
const boxChildren = Variable.derive(
|
||||||
[
|
[
|
||||||
bind(notifs, 'notifications'),
|
bind(notifdService, 'notifications'),
|
||||||
bind(notifs, 'dontDisturb'),
|
bind(notifdService, 'dontDisturb'),
|
||||||
bind(show_total),
|
bind(show_total),
|
||||||
bind(ignore),
|
bind(ignore),
|
||||||
bind(hideCountWhenZero),
|
bind(hideCountWhenZero),
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export function icon(name: string | null, fallback = icons.missing): string {
|
|||||||
|
|
||||||
if (lookUpIcon(icon)) return icon;
|
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;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user