chore: Improve relationship loading, include policies (#6321)

Use model where available in usePolicy
This commit is contained in:
Tom Moor
2023-12-28 12:51:33 -04:00
committed by GitHub
parent bd7d5c338d
commit 79764b1e64
16 changed files with 37 additions and 24 deletions

View File

@@ -32,7 +32,7 @@ function TitleDocumentMeta({ to, document, revision, ...rest }: Props) {
const totalViewers = documentViews.length;
const onlyYou = totalViewers === 1 && documentViews[0].userId;
const viewsLoadedOnMount = React.useRef(totalViewers > 0);
const can = usePolicy(document.id);
const can = usePolicy(document);
const Wrapper = viewsLoadedOnMount.current ? React.Fragment : Fade;