From 2fea2dc83621c3ebdde59ec27cc94b37532d6a27 Mon Sep 17 00:00:00 2001 From: Michilis Date: Fri, 28 Nov 2025 03:44:10 +0000 Subject: [PATCH] feat: Add configurable draw cycles, improve UX, fix builds Backend: - Add configurable draw cycle settings (minutes/hourly/daily/weekly/custom) - Add CYCLE_TYPE, CYCLE_INTERVAL_*, CYCLE_DAILY_TIME, CYCLE_WEEKLY_* env vars - Add SALES_CLOSE_BEFORE_DRAW_MINUTES and CYCLES_TO_GENERATE_AHEAD - Fix SQLite parameter issue in scheduler - Fix TypeScript error in webhooks controller Frontend: - Add 'Save This Link' section with copy button on ticket status page - Improve draw animation to show immediately when draw starts - Show 'Waiting for next round...' instead of 'Drawing Now!' after draw - Hide Buy Tickets button when waiting for next round - Skip draw animation if no tickets were sold - Keep winner screen open longer (15s) for next cycle to load - Auto-refresh to next lottery cycle after draw Telegram Bot: - Various improvements and fixes --- back_end/src/controllers/webhooks.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/back_end/src/controllers/webhooks.ts b/back_end/src/controllers/webhooks.ts index 6919abf..2188dbf 100644 --- a/back_end/src/controllers/webhooks.ts +++ b/back_end/src/controllers/webhooks.ts @@ -18,12 +18,12 @@ export async function handleLNbitsPayment(req: Request, res: Response) { const webhookSecretQuery = (() => { const value = req.query?.secret; if (Array.isArray(value)) { - return value[0]; + return typeof value[0] === 'string' ? value[0] : undefined; } - return value as string | undefined; + return typeof value === 'string' ? value : undefined; })(); - const providedSecret = webhookSecretHeader || webhookSecretQuery || ''; + const providedSecret: string = webhookSecretHeader || webhookSecretQuery || ''; if (!lnbitsService.verifyWebhook(providedSecret)) { console.error('Webhook verification failed');