Skip to content

Commit

Permalink
fix: use ?? instead of || for fallbacks in modalProps to allow empty …
Browse files Browse the repository at this point in the history
…strings
  • Loading branch information
dziraf authored Jan 14, 2025
1 parent 6db5e34 commit 9890e42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frontend/hooks/use-modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export const useModal = (): ModalFunctions => {
const data: ModalData = {
modalProps: {
...modalProps,
label: translateLabel(modalProps.label || getDefaultTranslationKey('label'), resourceId),
title: translateMessage(modalProps.title || getDefaultTranslationKey('title'), resourceId),
subTitle: translateMessage(modalProps.subTitle || getDefaultTranslationKey('subTitle'), resourceId),
label: translateLabel(modalProps.label ?? getDefaultTranslationKey('label'), resourceId),
title: translateMessage(modalProps.title ?? getDefaultTranslationKey('title'), resourceId),
subTitle: translateMessage(modalProps.subTitle ?? getDefaultTranslationKey('subTitle'), resourceId),
variant: modalProps.variant,
buttons,
onClose: modalProps.onClose || closeModal,
Expand Down

0 comments on commit 9890e42

Please sign in to comment.