From a93e475899848e81e146bb837c6112a6e965f037 Mon Sep 17 00:00:00 2001 From: NeilClack Date: Sat, 11 Jul 2026 16:36:15 -0500 Subject: [PATCH] Fix double-close panic on DownloadDone channel When transitioning from DOWNLOADING_ASSETS to READY, checkState() re-navigates to HOME. The new Home page sees the already-closed MessageChannel and tries to close DownloadDone again, causing a panic that restarts the process. Guard the close with a downloadDone bool field on Home. --- internal/page/home.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/page/home.go b/internal/page/home.go index 5e10bca..e32b913 100644 --- a/internal/page/home.go +++ b/internal/page/home.go @@ -32,6 +32,7 @@ type Home struct { baseFontSize int isDownloadComplete bool downloadFailed bool + downloadDone bool } // Init performs basic page initialization and creation of static assets. @@ -178,7 +179,10 @@ func (p *Home) Update(dt float32) error { } else { p.setMessage("Status: READY", colors.Green) p.isDownloadComplete = true - close(p.Context.DownloadDone) + if !p.downloadDone { + p.downloadDone = true + close(p.Context.DownloadDone) + } } return nil }