moderator-toolbox-nxg-for-reddit / modules/shared/proposals/approveCapture

modules/shared/proposals/approveCapture

Functions

handleApproveClick()

handleApproveClick(event): void

Defined in: extension/data/modules/shared/proposals/approveCapture.ts:133

Capture-phase handler: if a trainee clicked a native approve button (old Reddit or Shreddit), block it and capture the approval as a proposal instead. A no-op for everyone else.

Crucially, this never lets a native approve through on an unknown answer: a real approval is irreversible-ish for a sandbox feature, so when the synchronous trainee state isn’t warm yet (startup / just-navigated), an approve click is swallowed and the accurate async decision is awaited rather than falling open.

Parameters

event

MouseEvent

The captured click event.

Returns

void


installApproveCapture()

installApproveCapture(): void

Defined in: extension/data/modules/shared/proposals/approveCapture.ts:163

Installs the always-on approve interceptor. Called once from the proposals runtime so it stays active regardless of any module’s enabled state (a trainee must not be able to disable their own sandbox). Covers old Reddit and Shreddit.

Returns

void