()
| 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); |
nothing calls this directly
no test coverage detected