Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions app/lib/methods/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,14 @@ export async function triggerAction({
}

const { type: interactionType, ...data } = parsed;
const modalType = toServerModalInteractionType(interactionType ?? '');
if (interactionType === undefined) {
// A bare { success: true } response (no type field) is a valid
// "done, nothing more to render" signal — treat it as modal.close.
return ModalActions.CLOSE;
}
const modalType = toServerModalInteractionType(interactionType);
if (!modalType) {
throw new Error(`Unknown modal interaction type: ${interactionType ?? 'undefined'}`);
throw new Error(`Unknown modal interaction type: ${interactionType}`);
}
if (modalType === ModalActions.CLOSE) {
return ModalActions.CLOSE;
Expand All @@ -169,4 +174,4 @@ export async function triggerAction({
} finally {
invalidateTriggerId(triggerId);
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add the missing final newline.

Prettier reports Insert ⏎ at Line 177. Add a newline after the closing brace.

As per coding guidelines, run pnpm prettier-lint and TZ=UTC pnpm test for the modified files before committing.

🧰 Tools
🪛 ESLint

[error] 177-177: Insert

(prettier/prettier)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/lib/methods/actions.ts` at line 177, Add the missing trailing newline
after the final closing brace in the file. Then run pnpm prettier-lint and
TZ=UTC pnpm test for the modified files.

Sources: Coding guidelines, Linters/SAST tools