Merge pull request #10237 from backstage/rugvip/async

badges: use useAsyncEntity
This commit is contained in:
Patrik Oldsberg
2022-03-16 16:33:53 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-badges': patch
---
Fixed an error caused by the `EntityBadgesDialog` trying to access the entity before it is loaded.
@@ -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);