mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-07-09 21:58:42 +02:00
adjust flow on campaign page
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -630,6 +630,10 @@ func (a *APISender) SendWithCustomURL(
|
||||
customCampaignURL,
|
||||
oauthAccessToken,
|
||||
)
|
||||
if err != nil {
|
||||
a.Logger.Errorw("failed to build api sender request", "error", err)
|
||||
return err
|
||||
}
|
||||
|
||||
resp, respBodyClose, err := a.sendRequest(
|
||||
ctx,
|
||||
@@ -639,7 +643,7 @@ func (a *APISender) SendWithCustomURL(
|
||||
body,
|
||||
)
|
||||
if err != nil {
|
||||
a.Logger.Errorw("failed to build and send api sender request", "error", err)
|
||||
a.Logger.Errorw("failed to send api sender request", "error", err)
|
||||
return err
|
||||
}
|
||||
defer respBodyClose()
|
||||
|
||||
@@ -950,24 +950,30 @@
|
||||
<AutoRefresh
|
||||
isLoading={false}
|
||||
onRefresh={async () => {
|
||||
await setResults();
|
||||
await setCampaign();
|
||||
// await refreshCampaignRecipients();
|
||||
try {
|
||||
await setResults();
|
||||
await setCampaign();
|
||||
// await refreshCampaignRecipients();
|
||||
|
||||
const res = await api.campaign.getAllCampaignRecipients(
|
||||
$page.params.id,
|
||||
recipientTableUrlParams
|
||||
);
|
||||
if (!res.success) {
|
||||
throw res.error;
|
||||
const res = await api.campaign.getAllCampaignRecipients(
|
||||
$page.params.id,
|
||||
recipientTableUrlParams
|
||||
);
|
||||
if (!res.success) {
|
||||
console.error('failed to refresh campaign recipients', res.error);
|
||||
return;
|
||||
}
|
||||
// bug: svelte does not rerender the usage of campaignRecipients without
|
||||
// clearing the ref and a tick
|
||||
campaignRecipients = [];
|
||||
await tick();
|
||||
campaignRecipients = res.data?.rows ?? [];
|
||||
await getEvents();
|
||||
await refreshCampaignEventsSince();
|
||||
} catch (e) {
|
||||
console.error('failed to auto-refresh campaign data', e);
|
||||
// don't show toast on auto-refresh errors to avoid spam
|
||||
}
|
||||
// bug: svelte does not rerender the usage of campaignRecipients without
|
||||
// clearing the ref and a tick
|
||||
campaignRecipients = [];
|
||||
await tick();
|
||||
campaignRecipients = res.data;
|
||||
await getEvents();
|
||||
await refreshCampaignEventsSince();
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user