Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/web/src/hooks/useLogoSrc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
useBackground,
useResolvedTheme,
useSettings,
type Background,
} from "../stores/useSettings";

Expand All @@ -20,3 +21,9 @@ export function useLogoSrc() {
const theme = useResolvedTheme();
return getLogoSrc(background, theme);
}

/** 非 React 上下文中获取当前 logo 路径(快照式,无订阅) */
export function getCurrentLogoSrc(): string {
const { background, resolvedTheme } = useSettings.getState();
return getLogoSrc(background, resolvedTheme);
}
2 changes: 2 additions & 0 deletions src/web/src/hooks/useTaskNotifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import i18next from "i18next";
import { useWebSocket } from "../stores/useWebSocket";
import { useInstances } from "../stores/useInstances";
import { useSettings } from "../stores/useSettings";
import { getCurrentLogoSrc } from "./useLogoSrc";
import type {
InstanceId,
InstanceStatus,
Expand Down Expand Up @@ -105,6 +106,7 @@ function showCompletionNotification(
// 导致同一实例连续完成任务时后续通知不可见。
const notification = new Notification("Paimon", {
body: i18next.t("notification.taskComplete", { name: dirName }),
icon: getCurrentLogoSrc(),
});

// 点击通知:聚焦窗口并导航到对应实例
Expand Down