fix: use default values if translateWithId is falsy (#1282)

* fix(list-box-menu-icon): use default translations if `translateWithId` is undefined

* fix(list-box-selection): use default translations if `translateWithId` is undefined
This commit is contained in:
metonym 2022-05-03 19:43:07 -07:00 committed by GitHub
commit 877173df59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -22,7 +22,9 @@
[translationIds.open]: "Open menu",
};
$: description = open ? translateWithId("close") : translateWithId("open");
$: translationId = open ? translationIds.close : translationIds.open;
$: description =
translateWithId?.(translationId) ?? defaultTranslations[translationId];
</script>
<div