Skip to content

Commit

Permalink
Correct the logic for checking the existence of extensionDomain in …
Browse files Browse the repository at this point in the history
…the `bco` object within the `ExtensionDomain` component. This fix ensures accurate handling of the `extensionDomain` property. (#427)

- Update check from `"extension_domain" in bco` to `typeof bco.extensionDomain !== "undefined"`.
- Remove unnecessary comment from the remove button.

These changes improve the reliability and readability of the component.

Changes to be committed:
	modified:   client/src/components/builder/extensionDomain.js
  • Loading branch information
HadleyKing authored Jul 22, 2024
1 parent 73c7cc5 commit 33a68be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/src/components/builder/extensionDomain.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import Tooltip from "@mui/material/Tooltip";
export const ExtensionDomain = ({onSave}) => {
const dispatch = useDispatch();
const bco = useSelector(state => state.bco.data)
let has_extension = "extension_domain" in bco
let has_extension = typeof bco.extensionDomain !== "undefined";
const extensionDomain = has_extension ? bco.extension_domain : [];
const [newSchema, setNewSchema] = React.useState("")

const addExtension = async () => {
dispatch(getExtension({newSchema}))
.unwrap()
Expand Down Expand Up @@ -88,8 +88,6 @@ export const ExtensionDomain = ({onSave}) => {
fullWidth
onClick={() => removeRows(index)}>
<RemoveCircleIcon fontSize="23" />

{/* Remove */}
</Button>
</CardContent>)
}))
Expand Down

0 comments on commit 33a68be

Please sign in to comment.