diff --git a/.changeset/quiet-dots-raise.md b/.changeset/quiet-dots-raise.md new file mode 100644 index 0000000000..237cf47c81 --- /dev/null +++ b/.changeset/quiet-dots-raise.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-badges': patch +--- + +Fixed an error caused by the `EntityBadgesDialog` trying to access the entity before it is loaded. diff --git a/plugins/badges/src/components/EntityBadgesDialog.tsx b/plugins/badges/src/components/EntityBadgesDialog.tsx index 1ae5f69326..422dbc96a3 100644 --- a/plugins/badges/src/components/EntityBadgesDialog.tsx +++ b/plugins/badges/src/components/EntityBadgesDialog.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEntity } from '@backstage/plugin-catalog-react'; +import { useAsyncEntity } from '@backstage/plugin-catalog-react'; import { Box, Button, @@ -44,7 +44,7 @@ type Props = { export const EntityBadgesDialog = ({ open, onClose }: Props) => { const theme = useTheme(); - const { entity } = useEntity(); + const { entity } = useAsyncEntity(); const fullScreen = useMediaQuery(theme.breakpoints.down('sm')); const badgesApi = useApi(badgesApiRef);