3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fixed race condition

This commit is contained in:
Lily Bergonzat 2024-02-18 01:23:25 +01:00
parent ba65ecb48f
commit e4e7e1c695

View file

@ -88,7 +88,7 @@ async function casesUserCmd(
}
if (expand) {
sendExpandedCases(pluginData, context, casesToDisplay.length, casesToDisplay, show);
await sendExpandedCases(pluginData, context, casesToDisplay.length, casesToDisplay, show);
return;
}
@ -131,7 +131,7 @@ async function casesUserCmd(
fields: [...(isLastChunk ? [footerField] : [])],
} satisfies APIEmbed;
sendContextResponse(context, { embeds: [embed], ephemeral: !show });
await sendContextResponse(context, { embeds: [embed], ephemeral: !show });
}
}
@ -164,11 +164,11 @@ async function casesModCmd(
// Expanded view (= individual case embeds)
const cases = totalCases > 8 ? [] : await casesPlugin.getRecentCasesByMod(modId ?? author.id, 8, 0, casesFilters);
sendExpandedCases(pluginData, context, totalCases, cases, show);
await sendExpandedCases(pluginData, context, totalCases, cases, show);
return;
}
createPaginatedMessage(
await createPaginatedMessage(
pluginData.client,
context,
totalPages,
@ -257,8 +257,19 @@ export async function actualCasesCmd(
}
user
? casesUserCmd(pluginData, context, author.user, modId!, user, modName, typesToShow, hidden, expand, show === true)
: casesModCmd(
? await casesUserCmd(
pluginData,
context,
author.user,
modId!,
user,
modName,
typesToShow,
hidden,
expand,
show === true,
)
: await casesModCmd(
pluginData,
context,
author.user,