Skip to content

Commit 7c2a965

Browse files
authored
fix: add notification translator for notification validation:attachment:upload:in-progress (#2842)
1 parent a14367e commit 7c2a965

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/i18n/TranslationBuilder/notifications/NotificationTranslationTopic.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
attachmentUploadBlockedNotificationTranslator,
33
attachmentUploadFailedNotificationTranslator,
4+
attachmentUploadNotTerminatedTranslator,
45
} from './attachmentUpload';
56
import { TranslationTopic } from '../../TranslationBuilder';
67
import type { Notification } from 'stream-chat';
@@ -16,6 +17,7 @@ export const defaultNotificationTranslators: Record<
1617
'api:attachment:upload:failed': attachmentUploadFailedNotificationTranslator,
1718
'api:poll:create:failed': pollCreationFailedNotificationTranslator,
1819
'validation:attachment:upload:blocked': attachmentUploadBlockedNotificationTranslator,
20+
'validation:attachment:upload:in-progress': attachmentUploadNotTerminatedTranslator,
1921
'validation:poll:castVote:limit': pollVoteCountTrespass,
2022
};
2123

src/i18n/TranslationBuilder/notifications/attachmentUpload.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,10 @@ export const attachmentUploadFailedNotificationTranslator: Translator<
3636
// custom reason string
3737
return t('Attachment upload failed due to {{reason}}', { reason });
3838
};
39+
40+
export const attachmentUploadNotTerminatedTranslator: Translator<
41+
NotificationTranslatorOptions
42+
> = ({ options: { notification }, t }) => {
43+
if (!notification?.message) return null;
44+
return t('Wait until all attachments have uploaded');
45+
};

0 commit comments

Comments
 (0)