Skip to content

Commit

Permalink
fix revalidation usage of useLibraryMutation
Browse files Browse the repository at this point in the history
  • Loading branch information
Southclaws committed Oct 28, 2024
1 parent 03241a5 commit eb35e43
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function LibraryPageAssetList(props: Props) {
const isEmpty = assets.length === 0;
const shouldShow = editing || !isEmpty;

const { revalidate, addAsset, removeAsset } = useLibraryMutation();
const { revalidate, addAsset, removeAsset } = useLibraryMutation(props.node);

async function handleUpload(a: Asset) {
await handle(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export type Props = {
};

export function useLibraryPageCoverImageControl(props: Props) {
const { updateNode, removeNodeCoverImage, revalidate } = useLibraryMutation();
const { updateNode, removeNodeCoverImage, revalidate } = useLibraryMutation(
props.node,
);

const hasCoverImage = Boolean(props.node.primary_image);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export type Props = {

export function useLibraryPageMenu(props: Props) {
const account = useSession();
const { deleteNode, updateNodeVisibility, revalidate } = useLibraryMutation();
const { deleteNode, updateNodeVisibility, revalidate } = useLibraryMutation(
props.node,
);

const {
isConfirming: isConfirmingDelete,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function useLibraryPageScreen({ node }: Props) {
const libraryPath = useLibraryPath();
const account = useSession();
const { revalidate, updateNode, updateNodeVisibility, deleteNode } =
useLibraryMutation();
useLibraryMutation(node);

const cropperRef = useRef<FixedCropperRef>(null);

Expand Down

0 comments on commit eb35e43

Please sign in to comment.