(campaign: Campaign)
| 94 | }; |
| 95 | |
| 96 | const onStopBoost = async (campaign: Campaign) => { |
| 97 | const prompt = |
| 98 | campaign.flags?.origin === 'free_boost' |
| 99 | ? stopFreeBoostPromptOptions |
| 100 | : stopBoostPromptOptions; |
| 101 | |
| 102 | if (!(await showPrompt(prompt))) { |
| 103 | return; |
| 104 | } |
| 105 | |
| 106 | // The mutation already shows a toast when it fails |
| 107 | const data = await onCancelBoost(campaign).catch(() => null); |
| 108 | |
| 109 | if (data?.transactionId) { |
| 110 | clearBoostedFlag(campaign); |
| 111 | } |
| 112 | }; |
| 113 | |
| 114 | return { onStopBoost, isStopping: isLoadingCancel }; |
| 115 | }; |
nothing calls this directly
no test coverage detected