fix: applyTemplate用??替代||避免空字符串被回退为占位符

This commit is contained in:
2026-05-17 22:46:00 +08:00
parent a51ffb4de3
commit 8333d203db

View File

@@ -92,7 +92,7 @@ export function notifyInfo(title: string, detail: string): void {
}
function applyTemplate(template: string, vars: Record<string, string>): string {
return template.replace(/\{([^}]+)\}/g, (_, key) => vars[key] || '{' + key + '}');
return template.replace(/\{([^}]+)\}/g, (_, key) => vars[key] ?? '{' + key + '}');
}
function getEventTemplates(): Record<string, { title?: string; content: string }> {