mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
Fixed race condition
This commit is contained in:
parent
ba65ecb48f
commit
e4e7e1c695
1 changed files with 17 additions and 6 deletions
|
@ -88,7 +88,7 @@ async function casesUserCmd(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expand) {
|
if (expand) {
|
||||||
sendExpandedCases(pluginData, context, casesToDisplay.length, casesToDisplay, show);
|
await sendExpandedCases(pluginData, context, casesToDisplay.length, casesToDisplay, show);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ async function casesUserCmd(
|
||||||
fields: [...(isLastChunk ? [footerField] : [])],
|
fields: [...(isLastChunk ? [footerField] : [])],
|
||||||
} satisfies APIEmbed;
|
} 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)
|
// Expanded view (= individual case embeds)
|
||||||
const cases = totalCases > 8 ? [] : await casesPlugin.getRecentCasesByMod(modId ?? author.id, 8, 0, casesFilters);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
createPaginatedMessage(
|
await createPaginatedMessage(
|
||||||
pluginData.client,
|
pluginData.client,
|
||||||
context,
|
context,
|
||||||
totalPages,
|
totalPages,
|
||||||
|
@ -257,8 +257,19 @@ export async function actualCasesCmd(
|
||||||
}
|
}
|
||||||
|
|
||||||
user
|
user
|
||||||
? casesUserCmd(pluginData, context, author.user, modId!, user, modName, typesToShow, hidden, expand, show === true)
|
? await casesUserCmd(
|
||||||
: casesModCmd(
|
pluginData,
|
||||||
|
context,
|
||||||
|
author.user,
|
||||||
|
modId!,
|
||||||
|
user,
|
||||||
|
modName,
|
||||||
|
typesToShow,
|
||||||
|
hidden,
|
||||||
|
expand,
|
||||||
|
show === true,
|
||||||
|
)
|
||||||
|
: await casesModCmd(
|
||||||
pluginData,
|
pluginData,
|
||||||
context,
|
context,
|
||||||
author.user,
|
author.user,
|
||||||
|
|
Loading…
Add table
Reference in a new issue