fix: optional chaining for checking flag in listbox (#1572)

This commit is contained in:
Max Gefvert
2024-06-27 16:12:25 +02:00
committed by GitHub
parent 0dea433ef1
commit ec7ad50b35
2 changed files with 2 additions and 2 deletions

View File

@@ -102,7 +102,7 @@ function ListBoxInline({ options, layout }) {
const { translator, keyboardNavigation, themeApi, constraints } = useContext(InstanceContext);
const { checkboxes = checkboxesOption } = layout || {};
const themeSelectionColorsEnabled = flags.isEnabled('PS_22149_THEME_SELECTION_COLORS');
const themeSelectionColorsEnabled = flags?.isEnabled('PS_22149_THEME_SELECTION_COLORS');
const styles = getStyles({ app, themeApi, theme, components, checkboxes, themeSelectionColorsEnabled });
const isDirectQuery = isDirectQueryEnabled({ appLayout: app?.layout });

View File

@@ -99,7 +99,7 @@ export default function ListBoxPopover({
const [selectionState] = useState(() => createSelectionState({ selectDisabled }));
const { checkboxes = checkboxesOption } = layout || {};
const themeSelectionColorsEnabled = flags.isEnabled('PS_22149_THEME_SELECTION_COLORS');
const themeSelectionColorsEnabled = flags?.isEnabled('PS_22149_THEME_SELECTION_COLORS');
const styles = getStyles({ themeApi, theme, components, checkboxes, themeSelectionColorsEnabled });
useEffect(() => {