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

Function onButtonClick

packages/shared/src/features/boost/BoostSquadModal.tsx:158–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

onBuyCoresFunction · 0.70

Tested by

no test coverage detected