Message: Skip empty translations (#6731)
This commit is contained in:
parent
d7662901fa
commit
52da4643c1
@ -71,8 +71,9 @@ export function updateMessageTranslations<T extends GlobalState>(
|
|||||||
global: T, chatId: string, messageIds: number[], toLanguageCode: string, translations: ApiFormattedText[],
|
global: T, chatId: string, messageIds: number[], toLanguageCode: string, translations: ApiFormattedText[],
|
||||||
) {
|
) {
|
||||||
messageIds.forEach((messageId, index) => {
|
messageIds.forEach((messageId, index) => {
|
||||||
|
const text = translations[index];
|
||||||
global = updateMessageTranslation(global, chatId, messageId, toLanguageCode, {
|
global = updateMessageTranslation(global, chatId, messageId, toLanguageCode, {
|
||||||
text: translations[index],
|
text: text.text.length ? text : undefined,
|
||||||
isPending: false,
|
isPending: false,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user