From b0d1c8d9b185b4b6f49790e06be0a36176f4422d Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sun, 18 Jan 2026 10:51:42 -0600 Subject: [PATCH] fix TypeScript types for AutoDismissFlash hook --- assets/js/app.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assets/js/app.ts b/assets/js/app.ts index 715ec172..24dc8a7c 100644 --- a/assets/js/app.ts +++ b/assets/js/app.ts @@ -371,15 +371,17 @@ const ScrollToTop = { // LiveView hook for auto-dismissing flash messages const AutoDismissFlash = { - mounted() { + timeout: null as ReturnType | null, + mounted(this: any) { const dismissAfter = parseInt(this.el.dataset.dismissAfter || "30000", 10) this.timeout = setTimeout(() => { this.el.click() }, dismissAfter) }, - destroyed() { + destroyed(this: any) { if (this.timeout) { clearTimeout(this.timeout) + this.timeout = null } } }