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