Small cleanups

This commit is contained in:
Pieter Vander Vennet 2021-10-18 22:34:52 +02:00
parent 3f70892d75
commit 028767afe6
3 changed files with 7 additions and 5 deletions

View file

@ -217,9 +217,14 @@ export class Translation extends BaseUIElement {
static fromMap(transl: Map<string, string>) {
const translations = {}
let hasTranslation = false;
transl?.forEach((value, key) => {
translations[key] = value
hasTranslation = true
})
if(!hasTranslation){
return undefined
}
return new Translation(translations);
}
}