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

Function useCanBoostPost

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

Source from the content-addressed store, hash-verified

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

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