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
This commit is contained in:
Michilis
2025-11-28 03:44:10 +00:00
parent 918d3bc31e
commit 2fea2dc836

View File

@@ -18,12 +18,12 @@ export async function handleLNbitsPayment(req: Request, res: Response) {
const webhookSecretQuery = (() => { const webhookSecretQuery = (() => {
const value = req.query?.secret; const value = req.query?.secret;
if (Array.isArray(value)) { 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)) { if (!lnbitsService.verifyWebhook(providedSecret)) {
console.error('Webhook verification failed'); console.error('Webhook verification failed');