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

Function onButtonClick

packages/shared/src/features/boost/BoostPostModal.tsx:159–181  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

157 };
158
159 const onButtonClick = () => {
160 const hasEnoughBalance = balance >= totalSpendInt;
161
162 logBoostEvent(
163 LogEvent.StartBoost,
164 { budget: coresPerDay, duration: totalDays },
165 { has_enough_balance: hasEnoughBalance, boost_mode: mode },
166 );
167
168 if (!hasEnoughBalance) {
169 // Cores are bought into the wallet that pays for the boost
170 return canBuyCores ? onBuyCores() : undefined;
171 }
172
173 return onBoostPost({
174 duration: totalDays,
175 budget: coresPerDay,
176 value: post.id,
177 type: CampaignType.Post,
178 wallet,
179 audience: campaignAudience,
180 });
181 };
182
183 if (activeScreen === SCREENS.BUY_CORES) {
184 return (

Callers

nothing calls this directly

Calls 2

onBoostPostFunction · 0.85
onBuyCoresFunction · 0.70

Tested by

no test coverage detected