Skip to content

Commit 9890e42

Browse files
authored
fix: use ?? instead of || for fallbacks in modalProps to allow empty strings
1 parent 6db5e34 commit 9890e42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/frontend/hooks/use-modal.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ export const useModal = (): ModalFunctions => {
5252
const data: ModalData = {
5353
modalProps: {
5454
...modalProps,
55-
label: translateLabel(modalProps.label || getDefaultTranslationKey('label'), resourceId),
56-
title: translateMessage(modalProps.title || getDefaultTranslationKey('title'), resourceId),
57-
subTitle: translateMessage(modalProps.subTitle || getDefaultTranslationKey('subTitle'), resourceId),
55+
label: translateLabel(modalProps.label ?? getDefaultTranslationKey('label'), resourceId),
56+
title: translateMessage(modalProps.title ?? getDefaultTranslationKey('title'), resourceId),
57+
subTitle: translateMessage(modalProps.subTitle ?? getDefaultTranslationKey('subTitle'), resourceId),
5858
variant: modalProps.variant,
5959
buttons,
6060
onClose: modalProps.onClose || closeModal,

0 commit comments

Comments
 (0)