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

Function useCanBoostPost

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

Source from the content-addressed store, hash-verified

1356 (post?.scout?.id && post?.scout?.id === userId);
1357
1358export const useCanBoostPost = (post: Post) => {
1359 const { user } = useAuthContext();
1360 const canBuy = useCanPurchaseCores();
1361
1362 if (!user?.id) {
1363 return { canBoost: false };
1364 }
1365
1366 const canBoost =
1367 canBuy && checkCanBoostByUser(post, user.id) && !post?.private;
1368
1369 return { canBoost };
1370};
1371
1372export const BRIEFING_POSTS_PER_PAGE_DEFAULT = 20;
1373

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