We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5316bea commit 08405e7Copy full SHA for 08405e7
app/commands/track.tsx
@@ -16,7 +16,7 @@ export const handler = async (
16
) => {
17
const { targetMessage: message, user } = interaction;
18
19
- const { message: logMessage } = await reportUser({
+ const reportPromise = reportUser({
20
reason: ReportReasons.track,
21
message,
22
staff: user,
@@ -30,6 +30,10 @@ export const handler = async (
30
label="Delete message"
31
style="danger"
32
onClick={async () => {
33
+ // Need to ensure that we've finished reporting before we try to
34
+ // respond to a click event.
35
+ // Initiating at the top level and waiting here is a big UX win.
36
+ const { message: logMessage } = await reportPromise;
37
await Promise.allSettled([
38
message.delete(),
39
logMessage.reply({
0 commit comments