This commit is contained in:
2025-11-11 09:27:48 +01:00
parent 1d7d3bf2aa
commit fff9765940
3 changed files with 3 additions and 3 deletions

View File

@@ -28,7 +28,7 @@ async function sendNtfyNotification(adminNtfy, userNtfy, payload) {
const server = (userNtfy.serverUrl || adminNtfy.serverUrl || 'https://ntfy.sh').replace(/\/+$/, '');
const sanitizedPrefix = (adminNtfy.topicPrefix || '').replace(/^-+|-+$/g, '');
const sanitizedTopic = (userNtfy.topic || '').replace(/^-+|-+$/g, '');
const separator = sanitizedPrefix && sanitizedTopic ? '-' : '';
const separator = sanitizedPrefix && sanitizedTopic ? '_' : '';
const topic = `${sanitizedPrefix}${separator}${sanitizedTopic}` || sanitizedPrefix || sanitizedTopic;
let url = `${server}/${topic}`;
if (payload.title) {

View File

@@ -575,7 +575,7 @@ function App() {
return null;
}
const prefix = (notificationCapabilities.ntfy.topicPrefix || '').replace(/^-+|-+$/g, '');
const separator = prefix && sanitizedTopic ? '-' : '';
const separator = prefix && sanitizedTopic ? '_' : '';
const slug = `${prefix}${separator}${sanitizedTopic}` || sanitizedTopic || prefix;
if (!slug) {
return null;

View File

@@ -79,7 +79,7 @@ const NotificationPanel = ({
)}
{capabilities.ntfy.topicPrefix && (
<p className="text-xs text-gray-500">
Präfix: {capabilities.ntfy.topicPrefix} (Bindestrich wird automatisch ergänzt)
Präfix: {capabilities.ntfy.topicPrefix} (Unterstrich wird automatisch ergänzt)
</p>
)}
{ntfyPreviewUrl && (