From 0ade3b6b8512d38f5225ab3a1ab45aceb66e49e6 Mon Sep 17 00:00:00 2001 From: martincupela Date: Mon, 29 Sep 2025 11:53:40 +0200 Subject: [PATCH] fix: add notification translator for notification validation:attachment:upload:in-progress --- .../notifications/NotificationTranslationTopic.ts | 2 ++ .../TranslationBuilder/notifications/attachmentUpload.ts | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.ts b/src/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.ts index ec73833b4..33f6a55eb 100644 --- a/src/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.ts +++ b/src/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.ts @@ -1,6 +1,7 @@ import { attachmentUploadBlockedNotificationTranslator, attachmentUploadFailedNotificationTranslator, + attachmentUploadNotTerminatedTranslator, } from './attachmentUpload'; import { TranslationTopic } from '../../TranslationBuilder'; import type { Notification } from 'stream-chat'; @@ -16,6 +17,7 @@ export const defaultNotificationTranslators: Record< 'api:attachment:upload:failed': attachmentUploadFailedNotificationTranslator, 'api:poll:create:failed': pollCreationFailedNotificationTranslator, 'validation:attachment:upload:blocked': attachmentUploadBlockedNotificationTranslator, + 'validation:attachment:upload:in-progress': attachmentUploadNotTerminatedTranslator, 'validation:poll:castVote:limit': pollVoteCountTrespass, }; diff --git a/src/i18n/TranslationBuilder/notifications/attachmentUpload.ts b/src/i18n/TranslationBuilder/notifications/attachmentUpload.ts index b37836a7f..ae1febee4 100644 --- a/src/i18n/TranslationBuilder/notifications/attachmentUpload.ts +++ b/src/i18n/TranslationBuilder/notifications/attachmentUpload.ts @@ -36,3 +36,10 @@ export const attachmentUploadFailedNotificationTranslator: Translator< // custom reason string return t('Attachment upload failed due to {{reason}}', { reason }); }; + +export const attachmentUploadNotTerminatedTranslator: Translator< + NotificationTranslatorOptions +> = ({ options: { notification }, t }) => { + if (!notification?.message) return null; + return t('Wait until all attachments have uploaded'); +};