catalog-react: switch back to providing empty context from useEntity

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2021-09-12 15:48:53 +02:00
parent 3f26865c67
commit 98604bfab1
@@ -169,7 +169,15 @@ export function useEntity<T extends Entity = Entity>() {
useVersionedContext<{ 1: EntityLoadingStatus }>('entity-context');
if (!versionedHolder) {
throw new Error('Entity context is not available');
// TODO(Rugvip): Throw this once we fully migrate to the new context
// throw new Error('Entity context is not available');
return {
entity: undefined as unknown as T,
loading: true,
error: undefined,
refresh: () => {},
};
}
const value = versionedHolder.atVersion(1);