MCPcopy Create free account
hub / github.com/dailydotdev/apps / useCanBoostPost

Function useCanBoostPost

packages/shared/src/graphql/posts.ts:1443–1458  ·  view source on GitHub ↗
(post: Post)

Source from the content-addressed store, hash-verified

1441 (post?.scout?.id && post?.scout?.id === userId);
1442
1443export const useCanBoostPost = (post: Post) => {
1444 const { user } = useAuthContext();
1445 const canBuy = useCanPurchaseCores();
1446
1447 if (!user?.id) {
1448 return { canBoost: false };
1449 }
1450
1451 const canBoost =
1452 canBuy &&
1453 checkCanBoostByUser(post, user.id) &&
1454 !post?.private &&
1455 post?.type !== PostType.Brief;
1456
1457 return { canBoost };
1458};
1459
1460export const BRIEFING_POSTS_PER_PAGE_DEFAULT = 20;
1461

Callers 2

useShowBoostButtonFunction · 0.90
PostOptionButtonContentFunction · 0.90

Calls 3

useAuthContextFunction · 0.90
useCanPurchaseCoresFunction · 0.90
checkCanBoostByUserFunction · 0.85

Tested by

no test coverage detected