mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-22 06:41:46 +00:00
feat: route Synology session-cleared notification through unified send()
Replace direct createNotification() call with notificationService.send() so the notification respects user preferences and reaches all enabled channels (in-app, email, webhook) instead of only WebSocket. Registers synology_session_cleared as a proper NotifEventType (inapp-only) and adds localized text for all 14 supported languages.
This commit is contained in:
@@ -19,7 +19,7 @@ import {
|
||||
SyncAlbumResult,
|
||||
AssetInfo
|
||||
} from './helpersService';
|
||||
import { createNotification } from '../inAppNotifications';
|
||||
import { send as sendNotification } from '../notificationService';
|
||||
|
||||
const SYNOLOGY_PROVIDER = 'synologyphotos';
|
||||
// Users provide the full base URL including the Photos app path (e.g. https://nas:5001/photo).
|
||||
@@ -374,13 +374,12 @@ export async function updateSynologySettings(userId: number, synologyUrl: string
|
||||
const sessionCleared = urlChanged || userChanged;
|
||||
if (sessionCleared) {
|
||||
_clearSynologySession(userId);
|
||||
createNotification({
|
||||
type: 'simple',
|
||||
sendNotification({
|
||||
event: 'synology_session_cleared',
|
||||
actorId: null,
|
||||
params: {},
|
||||
scope: 'user',
|
||||
target: userId,
|
||||
sender_id: null,
|
||||
title_key: 'notifications.synologySessionCleared.title',
|
||||
text_key: 'notifications.synologySessionCleared.text',
|
||||
targetId: userId,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user